by
KK » Mon Mar 28, 2011 7:32 pm
I think I really must get a prolonged session of sleep now

You are right, I messed with that ending tag. It was supposed to be 'pages'.
Anyways, you can use any of the following snippets that suits your need.
1. Show a list of latest 5 pages belonging to the folder being shown in folder-view (i.e. if visiting 'animation' folder, show 5 pages that belong to 'animation') -
- Code: Select all
<cms:if k_is_folder>
<ul>
<cms:pages masterpage='work.php' folder=k_folder_name limit='5'>
<li><a href="<cms:show k_page_link/>"><cms:show k_page_title/></a></li>
</cms:pages>
</ul>
</cms:if>
2. Show a list of latest 5 pages belonging to either the folder being shown in folder-view (i.e. if visiting 'animation' folder, show 5 pages that belong to 'animation') or belonging to the containing folder of the page being shown in page-view (i.e. if visiting page 'chicken-scratch.html' that is within 'animation' folder, show 5 pages from 'animation') -
- Code: Select all
<cms:if k_is_folder || k_is_page>
<cms:if k_is_folder><cms:set my_folder=k_folder_name /></cms:if>
<cms:if k_is_page><cms:set my_folder=k_page_foldername /></cms:if>
<ul>
<cms:pages masterpage='work.php' folder=my_folder limit='5'>
<li><a href="<cms:show k_page_link/>"><cms:show k_page_title/></a></li>
</cms:pages>
</ul>
</cms:if>
Notice how in the code above we are using 'k_folder_name' for folder-view and 'k_page_foldername' for page-view.
Hope this helps. Do let me know.