Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hello,

I'm using clonable templates to allow my client to create groups of items that I want to display on a page together with separators between them.

Is there any way for me to know, within a <cms:pages>...</cms:pages> section, if the current item is the last one or not? Or is there a better way to insert separators between items?

Kind regards,
Brian
Hi Brian,

I assume you wish not to output the separator after the last page in the listing. Following could be one way of doing so -
Code: Select all
<cms:pages masterpage='blog.php'>
    <h2><cms:show k_page_title/></h2>
    <cms:if "<cms:not k_paginated_bottom />">
        <hr />
    </cms:if>
</cms:pages>

As a tip - please try putting <cms:dump /> within the cms:pages block to see all the variables that get available. The 'k_paginated_bottom' we are using above is one but you'll spot a few more that we could have used to find if the page being listed is the last page.

Hope it helps.
Perfect! Thanks so much for the speedy reply. I will be sure to try <cms:dump /> next time.
3 posts Page 1 of 1