Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Suddenly a simple macro parameter with type mediaCurrent returned a strange non-numeric value to a Xslt.
<umbraco:macro MediaRootId="2336" alias="DocumentsForFrontpage" runat="server"></umbraco:macro>
And in the Xslt:
<xsl:variable name="macroMediaRootId" select="/macro/MediaRootId"/> Debug: (<xsl:value-of select="$macroMediaRootId"/>)
The output was 01194MyDocumentTypeAlias instead of 2336. Anyone have a clue of how that could have happened? I dont.
Regards
Jonas
I'm not so concerned about this for the current problem, but more as a general thing. Is it a sign of some error in the site xml content?
Hi Jonas,
you are rendering the full node content, you you have to reference the id specifically, e.g. like this:
<xsl:variable name="macroMediaRootId" select="/macro/MediaRootId/node/@id">
Hi Tommy, that works - great!
But that means I have missed something essential. The info here http://umbraco.org/documentation/books/macro-parameters-syntax/setting-up-a-macro-parameter says :
"Okey so now we have a macro with some parameters. Lets get these parameters into the xslt.
Our Xslt code (without the stylesheet info):
<xsl:template match="/"> <xsl:copy-of select="/macro/text"> <xsl:copy-of select="/macro/contentTree"> </xsl:template>
"
regards / Jonas
Ah, stupid of me - the mediaCurrent returns whole node, ah, forget the last question.
Goodie - I'm glad you figured it out ;-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
What happened behind the hood with my parameter value?
Suddenly a simple macro parameter with type mediaCurrent returned a strange non-numeric value to a Xslt.
<umbraco:macro MediaRootId="2336" alias="DocumentsForFrontpage" runat="server"></umbraco:macro>
And in the Xslt:
The output was 01194MyDocumentTypeAlias instead of 2336. Anyone have a clue of how that could have happened? I dont.
Regards
Jonas
I'm not so concerned about this for the current problem, but more as a general thing. Is it a sign of some error in the site xml content?
Hi Jonas,
you are rendering the full node content, you you have to reference the id specifically, e.g. like this:
Hi Tommy, that works - great!
But that means I have missed something essential. The info here http://umbraco.org/documentation/books/macro-parameters-syntax/setting-up-a-macro-parameter says :
"Okey so now we have a macro with some parameters. Lets get these parameters into the xslt.
Our Xslt code (without the stylesheet info):
"
regards / Jonas
Ah, stupid of me - the mediaCurrent returns whole node, ah, forget the last question.
Goodie - I'm glad you figured it out ;-)
is working on a reply...