Repeating Image HTML in vbcms_content_section
I want to place an image using html in the content section index page after so many entries. What I have so far is that works to place the image after the Nth entry is below. But, I want it to be after the 4, 8, 12, etc listing on the index page.
<vb:each from="contents" key="id" value="content">
<div class="fullwidth<vb:if condition="$id != 1"> cms_separator</vb:if>">
{vb:raw content}
</div>
<vb:if condition="$id == 5">
<div class="fullwidth cms_separator">
IMAGE HTML HERE
</div>
</vb:if>
</vb:each>
I have tried this to get the interval I want (I also tried a long string of nested IF statements, but won't cut and paste that mess in here since I suspect there is a much cleaner way to do it):
vb:each from="contents" key="id" value="content">
<div class="fullwidth<vb:if condition="$id != 1"> cms_separator</vb:if>">
{vb:raw content}
</div>
<vb:if condition="$id == 4 OR 8 OR 12 or 16">
<div class="fullwidth cms_separator">
IMAGE
</div>
</vb:if>
</vb:each>
Once that problem is solved, if possible, I would also like it to be displayed for all user groups, except for group 117. To hide it for the 117 group I tried below. It doesn't return an error, but it doesn't show the image to any group:
vb:each from="contents" key="id" value="content">
<div class="fullwidth<vb:if condition="$id != 1"> cms_separator</vb:if>">
{vb:raw content}
</div>
<vb:if condition="!is_member_of($bbuserinfo, 117)">
<vb:elseif condition="$id == 4">
<div class="fullwidth cms_separator">
IMAGE
</div>
</vb:elseif>
</vb:if>
</vb:each>
I'm new to this and learning quick but not quick enough since this one has stymied me so far. I got the exact same concept to work in a thread by using the remainder function, but no luck yet in the content_section template. Any ideas? Thanks!
|