by
KK » Wed May 01, 2013 3:01 am
Hi Potato,
As stated in the docs, nested pages can be used in-lieu of normal cloned pages for sections that are not likely to have thousands of cloned pages (having hundreds of pages is perfectly alright).
Most portfolio sections, sliders etc. will fit the bill.
Using nested-pages gives the additional benefit of having the ability to easily change the display order of pages (using up/down arrows in admin) and also having the next and prev links that are the topic of this thread.
In
list-view, this is how
cms:nested_pages tag can be used instead of our regular
cms:pages tag to create paginated listing (the pagination part is
exactly the same as that used with cms:pages)-
- Code: Select all
<cms:nested_pages masterpage='index.php' include_custom_fields='1' paginate='1' limit='5' >
<cms:if k_paginated_top>
<cms:if k_paginator_required >
Page <cms:show k_current_page /> of <cms:show k_total_pages /><br>
</cms:if>
<cms:show k_total_records /> records Found.
Displaying: <cms:show k_record_from />-<cms:show k_record_to />
<br /><hr />
</cms:if>
<!-- Values of all fields defined in the nested-pages are available here -->
<a href="<cms:show k_nestedpage_link />"><cms:show k_nestedpage_title /></a><br />
<cms:paginator />
</cms:nested_pages>
or
- Code: Select all
<cms:nested_pages masterpage='index.php' include_custom_fields='1' paginate='1' limit='5' >
<cms:if k_paginated_top>
<cms:if k_paginator_required >
Page <cms:show k_current_page /> of <cms:show k_total_pages /><br>
</cms:if>
<cms:show k_total_records /> records Found.
Displaying: <cms:show k_record_from />-<cms:show k_record_to />
<br /><hr />
</cms:if>
<!-- Values of all fields defined in the nested-pages are available here -->
<a href="<cms:show k_nestedpage_link />"><cms:show k_nestedpage_title /></a><br />
<cms:if k_paginated_bottom >
<cms:if k_paginate_link_prev >
<a href="<cms:show k_paginate_link_prev />">prev</a>
</cms:if>
<cms:if k_paginate_link_next >
<a href="<cms:show k_paginate_link_next />">next</a>
</cms:if>
</cms:if>
</cms:nested_pages>
Datsun actually meant creating the next and prev links within a
page-viewThis is how it can be done -
- Code: Select all
<cms:if k_prev_nestedpage_link >
<a href="<cms:show k_prev_nestedpage_link />">« <cms:show k_prev_nestedpage_title /></a>
</cms:if>
<cms:if k_next_nestedpage_link >
<a href="<cms:show k_next_nestedpage_link />"><cms:show k_next_nestedpage_title /> »</a>
</cms:if>
Hope this helps.