Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • James Bond 2 posts 22 karma points
    Jun 07, 2011 @ 11:06
    James Bond
    0

    Showing all child nodes of a top level page

    I am very new to XSLT and would like to do the following on a simple - sample site I am building.

     

     I would like to put in a top level page id (for example 1000 for the about-us page) which will then list all the sub pages of this top level page.

     

    Because these links will be shown on all pages I do not want the links to change when I go on another page like the news section. Could someone please point me in the direction of a resource that will help me do this.

    Thanks

  • John C Scott 473 posts 1183 karma points
    Jun 07, 2011 @ 16:01
    John C Scott
    0

    This is what I understand you mean...

    You have a template and in that template you want to list all the children of a specific node.

    So for example this is the master template that other sections inherit from and on every page you'd like ever node in your FAQ section to be listed.

    So if you were viewing content in the News section you would want the same pages from the FAQ section listed, if you were on the contact us page you would still like every page from the FAQ section listed. So the source of the list is absolute and not relative.

    If this is what you want there is a very simple way to do this.

    If you create a new macro you have the option of several templates to choose from. One of these is "List Sub Pages From A Changeable Source".

    The important thing now is to go into the macro that was created for the XSLT file with the same name and now add a parameter with name and alias of "Source" and show ticked and of type "Content Picker".

    Now when you add this macro to your template you will be prompted to pick a source node. It will add this as an attribute of the macro include as source="1234" and then all children of 1234 will be listed by the template. You can then hack the template to get the output you'd like.

     

Please Sign in or register to post replies

Write your reply to:

Draft