Hello, a question on repeatable regions and the value in k_total_records.
I have a clonable template displaying a gallery which is set up as a repeatable region.
Within the <cms:pages> tag I am showing each cloned page including the gallery. For my second cloned page there is currently no gallery - so I don't want anything to display (including the <ul> tag, set up outside the <cms:show_repeatable> tag).
I expected to be able to use k_total_records to detect whether anything was set up for the repeatable region (i.e. check that k_total_records is 0). But regardless of whether startcount is set to 0 or 1, the value of k_total_records is = 1 for the 2nd cloned page's repeatable region.
I can stop the <li> elements being displayed by checking if the thumbnail is there or not, but I would like to be able to do a pre-display check of the repeatable region to test for nothing being present and stop the <ul> tag - and thought k_total_records could do this.
k-count and k-total-records from the above code displays "0 / 1" even though there are no entries in the repeatable region.
I wonder if you could enlighten me? Thanks!
I have a clonable template displaying a gallery which is set up as a repeatable region.
Within the <cms:pages> tag I am showing each cloned page including the gallery. For my second cloned page there is currently no gallery - so I don't want anything to display (including the <ul> tag, set up outside the <cms:show_repeatable> tag).
I expected to be able to use k_total_records to detect whether anything was set up for the repeatable region (i.e. check that k_total_records is 0). But regardless of whether startcount is set to 0 or 1, the value of k_total_records is = 1 for the 2nd cloned page's repeatable region.
I can stop the <li> elements being displayed by checking if the thumbnail is there or not, but I would like to be able to do a pre-display check of the repeatable region to test for nothing being present and stop the <ul> tag - and thought k_total_records could do this.
- Code: Select all
<ul>
<cms:show_repeatable 'book_gallery' startcount='0' >
<cms:show k_count /> / <cms:show k_total_records /><br/>
<cms:if k_count lt '6'>
<cms:if thumbnail_book_img ><li><img src="<cms:show thumbnail_book_img />" alt="<cms:show k_page_title />" /></li></cms:if>
</cms:if>
</cms:show_repeatable>
</ul>
k-count and k-total-records from the above code displays "0 / 1" even though there are no entries in the repeatable region.
I wonder if you could enlighten me? Thanks!