XF 2.0 Contentcheck in nested xf tag...

Liam W

in memoriam 1998-2020
I might be remembering wrong, but I'm almost certain that in XF1, it didn't matter how nested the <xen:contentcheck> tag was, it would still work.

In XF2, it would appear that the if contentcheck system only works if the <xf:contentcheck> tag is a direct descendent of the xf:if tag (ignoring HTML tags).

Is this deliberate, if so why, or have I mis-remembered how it worked in XF1?

Liam
 
You've misremembered how it worked in XF1 -- it's the exact same. It doesn't make sense to really do anything else. A contentcheck nested in a foreach would be totally ambiguous. In many other cases, other tags aren't just wrappers around HTML (form tags with options) that don't process their children normally, etc.
 
Hmmm,
how can i do this, please:

check
ul
foreach arr => x
if x => li>something</li
/foreach
/ul
check

if there is no value x, i have no li, also i dont want to have an ul
 
Wrap the entire block in an xf:if tag, and but the xf:contentcheck tag directly above the foreach tag - if the foreach tag doesn't render anything (I.E, x is always fale), then the stuff inside the xf:if tag won't be rendered (the ul).
 
Thank you. I have solved it meanwhile by the need of a special value; but good to know how to do it without this also. :)
 
Top Bottom