PDA

View Full Version : Trying to iterate through CMS articles and inject code between them


rocketpig
06-06-2014, 03:09 PM
As the title states, I'm trying to add code that will inject mark-up between CMS article previews on the CMS index page. In a perfect world, I could choose to add an advertisement or sign-up form after, let's say, every fourth article preview.

I do this in the forum between posts... But I can't find the correct variable to iterate through CMS articles. I have bolded the area that needs to be changed, can anyone help?

In my example code, every 20 posts this snippet will inject code after the 11th post. Any suggestions? I've tried to find a list of vB variables to look through to find what generates the CMS code but I can't find what I'm looking for.

<vb:if condition="$post[postcount] % 20 == 11">
<div>
CODE GOES HERE
</div>
</vb:if>