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.
Find the belonging macro in the macro folder (it most likely is called the same as the xslt file)
Click on the Parameters tab in the macro. Here you add parameters that you can use in the xslt.
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.
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".
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
Hi Tony
It is quite simple...
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".
Thank you,
"the magic" did indeed occur and I was asked for the node.
You know, I could get to like this :)
Tony
is working on a reply...