Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I'm probably missing something obvious but this is driving me nuts! :lol:

I have a couple of different templates all with nested pages. I want to list the children of a different template on a page but I can never seem to get exactly what I'm looking for.

Code: Select all
<cms:nested_pages masterpage='parents.php' depth='2'>
        <li><a href="<cms:show k_nestedpage_link />" ><cms:show k_nestedpage_title /></a></li>
    </cms:nested_pages>

Shows all the children, but also includes the parent.

Using the childof parameter doesn't display anything at all.

Any help would be awesome, it's litterally the last hurdle I'm running into.

:)
Let the awesomeness come right now, then :)

I'll quote 'depth' from here http://docs.couchcms.com/tags-reference ... html#depth
list only the top-level pages in the tree by setting the depth to 1. A depth of 0 means unlimited depth.

Since your tree's root is now set to a certain page with childof, then depth is recalculated. Therefore the probable solution: depth='1'.
Code: Select all
<cms:nested_pages masterpage='seo.php' childof='home' depth='1' >
        <li><a href="<cms:show k_nestedpage_link />" ><cms:show k_nestedpage_title /></a></li>
</cms:nested_pages>

Please, test and let us know if it worked. However, even with depth='2' your pages should have been listed. This leads us to the following:

Another probable reason that your code was not working: childof parameter needs page-name, not page-title. Make sure you put there correct name of page. Sometimes they name and title only look similar.

If this also doesn't help, then make sure your pages are checked with 'show in menu' setting.
ignore_show_in_menu
The 'Advanced Settings' of each nested-page has a checkbox labeled 'Show in menu'.
If that is unchecked, the page (an all its child pages) is not included by default in the listing.
You can override this by setting 'ignore_show_in_menu' parameter to '1'
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
THANK YOU! :D

childof parameter needs page-name, not page-title


That was it, so so stupid of me. :oops:
3 posts Page 1 of 1