Hi all, I am trying to do something fairly simple but I cannot seem to get this to work.
I have a simple macro which has a content picker parameter called "linkOne".
When I try to extract this out in XSLT I was expecting the ID of the selected page to come out. However it brings back the whole document xml for the chosen page. Even if I don't select a page in the content picker, the XSLT returns the whole XML structure of the current page.
Can you double check that the type of the macro parameter is Content Picker and not Content Random or Content Tree? Those are (to my knowledge) the only ones returning XML from content nodes...
If you have indeed specified Content Picker as the type, then we need to dig deeper - there could be a bug somewhere that no-one has seen yet.
Which version of Umbraco are you experiencing this in?
It is definately a content picker. The macro itself is being inserted through TinyMce into the page content. When I pull the value back out it gives me the whole page node xml. I'm running 6.1.0.
Well - if the macro parameter returns the full structure, then the node's id would be in $link1/@id - but since you'd most likely be using that to get to the node, you could just use the node you already have, e.g. ig you need to output its name, you'd say:
<xsl:value-of select="$link1/@nodeName" />
What is it do you're specifically trying to do - is it not possible inthis way?
Content Picker Parameter to XSLT
Hi all, I am trying to do something fairly simple but I cannot seem to get this to work.
I have a simple macro which has a content picker parameter called "linkOne".
When I try to extract this out in XSLT I was expecting the ID of the selected page to come out. However it brings back the whole document xml for the chosen page. Even if I don't select a page in the content picker, the XSLT returns the whole XML structure of the current page.
Am I missing something really simple?
<xsl:variable name="link1" select="/macro/linkOne"/>
Link one <xsl:value-of select="$link1" /> ... this returns the whole xml structure for the node
Thanks in advance
Hi Dave,
Can you double check that the type of the macro parameter is Content Picker and not Content Random or Content Tree? Those are (to my knowledge) the only ones returning XML from content nodes...
If you have indeed specified Content Picker as the type, then we need to dig deeper - there could be a bug somewhere that no-one has seen yet.
Which version of Umbraco are you experiencing this in?
/Chriztian
Found the case,
If you use currentPage as variable for content picker then it will load whole page there as it is reserved variable i think
Hi Chriztian
It is definately a content picker. The macro itself is being inserted through TinyMce into the page content. When I pull the value back out it gives me the whole page node xml. I'm running 6.1.0.
Thanks
continued same bug in version 7
Found the case,
If you use currentPage as variable for content picker then it will load whole page there as it is reserved variable i think
I solved by it by restoring my currentPage variable as it was and took a new variable named selectedPage(any other).
Wrong Way
Right way
Ah - that makes sense :)
@Chriztian can i get you to look at
https://our.umbraco.org/forum/templates-partial-views-and-macros//83640-xslt-generate-html-without-transformation#comment-83640
Hi,
Well - if the macro parameter returns the full structure, then the node's id would be in
$link1/@id
- but since you'd most likely be using that to get to the node, you could just use the node you already have, e.g. ig you need to output its name, you'd say:What is it do you're specifically trying to do - is it not possible inthis way?
/Chriztian
is working on a reply...