Originally posted by Kent Multer
View Post
Edited the code in the post.
Thanks Kent!
<mvt:assign name="g.reqpos" value="1" />
<mvt:foreach iterator="attribute" array="attributes">
<mvt:if expr="l.settings:attribute:required">
<mvt:assign name="g.reqpos" value="g.reqpos + 1 " />
<mvt:foreachstop />
</mvt:if>
</mvt:foreach>
<mvt:if expr="g.reqpos GT 1">
CONTENT IF REQUIRED ATTRIBUTE EXISTS
<mvt:else>
other content (this content and the <mvt:else> are not required if only showing content based on required attributes existing)
</mvt:if>
<mvt:assign name="g.nonreqpos" value="1" />
<mvt:foreach iterator="attribute" array="attributes">
<mvt:if expr="l.settings:attribute:required">
<mvt:comment> ========== Important to keep this blank and free of code or text ========== </mvt:comment>
<mvt:else>
<mvt:assign name="g.nonreqpos" value="g.nonreqpos + 1 " />
<mvt:foreachstop />
</mvt:if>
</mvt:foreach>
<mvt:if expr="g.nonreqpos GT 1">
CONTENT IF NON-REQUIRED ATTRIBUTE EXISTS
<mvt:else>
other content (this content and the <mvt:else> are not required if only showing content based on non-required attributes existing)
</mvt:if>
<mvt:assign name="g.attribute_count" value="miva_array_elements( l.settings:attributes )" /> <mvt:if expr="g.attribute_count EQ 0"> There are no attributes <mvt:else> There are attributes </mvt:if>
Leave a comment: