Copied to clipboard

Flag this post as spam?

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


  • tony 15 posts 35 karma points
    Oct 17, 2010 @ 23:10
    tony
    0

    List Sub Pages From A Changable Source

    Hi,

    I wonder if anyone can help?  I have node types "NewsSection" and "NewsItem".  I want to list News Items, from many different templates.  I think to select the appropriate nodes I use the "List Sub Pages From A Changable Source" macro template, my thoughts being whatever template I am working in, I can call the macro and it will always look in the same node (I might be wrong in my understanding though!)

    When I create this macro, obviously I have to specify the node I want to use, there is a comment in the template...

    <xsl:param name="currentPage"/>
    <!-- Don't change this, but add a 'contentPicker' element to -->
    <!-- your macro with an alias named 'source' -->
    <xsl:variable name="source" select="/macro/source"/>

     Apologies for my naivety, but having spent most of the day Googling, I cannot determine how you "add a contentPicker to the macro.  I read it as needing a property in the macro, of type contentPicker, but I don't understand how I do that, and then how I use it.

    Any advice or links on where to start?

     

    Many thanks

     

    Tony

  • Kasper Dyrvig 246 posts 379 karma points
    Oct 18, 2010 @ 08:26
    Kasper Dyrvig
    0

    Hi Tony

    It is quite simple...

    1. Find the belonging macro in the macro folder (it most likely is called the same as the xslt file)
    2. Click on the Parameters tab in the macro. Here you add parameters that you can use in the xslt.
    3. In the Alias field type "source". In the Name field you can type something that describes what to do, e.g. "Choose source". As Type select "contentPicker". Finally click Add.
    4. Now go to the template you want the macro in. Set the marker where you want the macro. Click on the Insert macro button. Choose your macro, click OK - and the magic happens: you will be asked to select a source!

    And you are done!

    If you want to be able to use the macro in a rich text editor, go to the macro and check the "Use in editor".

  • tony 15 posts 35 karma points
    Oct 18, 2010 @ 08:37
    tony
    0

    Thank you,

     

    "the magic" did indeed occur and I was asked for the node.

    You know, I could get to like this :)

     

    Tony

Please Sign in or register to post replies

Write your reply to:

Draft