We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14214
    • 299 Posts
    I am working with a custom snippet that gathers information from an external db. It does allow a template but I am struggling with idx to identify the last item.

    Right now I am using [[!If? &subject=`[[+_idx:increment:modulus=`4`]]` &operator=`EQ` &operand=`1` &then=`<div class="row" `]]

    This will add a div class row to the output.

    At the end of the template I have :

    [[!If? &subject=`[[+_idx:increment:modulus=`4`]]` &operator=`EQ` &operand=`0` &then=`</div>`]]


    The problem is that rows with less than 4 items it does not close the div tag "row" and thus messes up the template. With restriction to this single template, how do I identify the last item and close it?
    [ed. note: jisaac last edited this post 10 years, 3 months ago.]
      • 12893
      • 13 Posts
      Does anyone know how to use the utilize idx within a FileLister template? I am generating a list of files within a directory, and in my output template I need to somehow generate the number of each item listed (1, 2, 3, etc...). The output template would be within an XML file so I cannot simply use an ordered list.