Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
I have to display in each page footer, links to Twitter, Facebook, G+ ..... so I included in my globals.php the following repeatable region:
Code: Select all
<cms:repeatable name='sn' label='Social networks' >
      <cms:editable name='name' label='Network name' col_width='100' type='text' />
                <cms:editable name='link' label='Link to network' col_width='200' type='text' />
      <cms:editable name='logo' label='FontAwesome network logo' col_width='200' type='text' />                  
   </cms:repeatable>

I was trying to display the infos this way, but without any luck:
Code: Select all
<cms:show_repeatable 'sn' >
      <a href="<cms:get_custom_field 'link' masterpage='globals.php' />"><i class="<cms:get_custom_field 'logo' masterpage='globals.php' />"></i></a>
   </cms:show_repeatable>

What I'm doing wrong?
Hi @atisz,

The 'sn' repeatable region belongs to globals.php. Let's say you are visiting another template (about.php); your current code will look for a repeatable region named 'sn' in that template and not globals.php.

Please try the following:
Code: Select all
<cms:pages masterpage='globals.php' limit='1'>
    <cms:show_repeatable 'sn'>
        <a href="<cms:show link/>"><i class="<cms:show logo/>"></i></a>
    </cms:show_repeatable>
</cms:pages>
Thank you cheesypoof! Again :) It's working now.
maybe not right to post here but...

how do i get the repeatable region to display only ONE entry?
pages has limit, but i gather show_repeatable doesn't have this feature?

Code: Select all
<cms:show_repeatable 'phone_numbers'>
    <cms:show number />
</cms:show_repeatable>


I have entered 3 numbers from the backend, but on a certain page i choose only to display one phone number.
---
You live many times, but only ever remember your lives.length - 1
---
Image
@cholasimmons, we can use the k_count variable that keeps track of the iteration number -
Code: Select all
<cms:show_repeatable 'phone_numbers'>
    <cms:if k_count='1'>
        <cms:show number />
    </cms:if>
</cms:show_repeatable>

Hope this helps.
5 posts Page 1 of 1