Hi everyone,
I'm new to Couchcms and I'm trying to make a link appear only on the last page of a cloned template. I tried some solutions, but it's working only if I have only two projects. If I have more than two, it makes both links appear on the second page. Someone has a solution?
This is my code:
Thanks for your help!
I'm new to Couchcms and I'm trying to make a link appear only on the last page of a cloned template. I tried some solutions, but it's working only if I have only two projects. If I have more than two, it makes both links appear on the second page. Someone has a solution?
This is my code:
- Code: Select all
<cms:set cur_page=k_page_name 'global' />
<cms:set prev_page='' 'global' />
<cms:set next_page='' 'global' />
<cms:set found_cur_page='0' 'global' />
<cms:pages skip_custom_fields='1'>
<cms:if found_cur_page=='0'>
<cms:if k_page_name==cur_page>
<cms:set found_cur_page='1' 'global' />
<cms:else />
<cms:set prev_page=k_page_link 'global' />
</cms:if>
<cms:else />
<cms:if next_page==''>
<cms:set next_page=k_page_link 'global' />
</cms:if>
</cms:if>
</cms:pages>
<cms:if next_page>
<a href="<cms:show next_page />" class="next-project">First Project</a>
</cms:if>
<cms:pages start_on=k_page_date order='asc' limit='1' offset='1'>
<a href="<cms:show k_page_link />" class="next-project">Next Project</a>
</cms:pages>
Thanks for your help!