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
i have a content picker property 'imageFront' that i wish to retrive in my xslt. I wish to choose the closest ancestor
ie so this works as page field
<umbraco:Item field="imageFront" recursive="true" runat="server"></umbraco:Item> // 1401
How would i get this value '1401' into my macro. I heard you can use #. Where would this live
My XSLT macro
<umbraco:Macro propertyAlias="imageFront" altText="alt" imageWidth="400" imageHeight="400" Alias="Image" runat="server"></umbraco:Macro
I've also tried just looking up by ancestor, but it's empty.
<xsl:variable name="myImage" select="$currentPage/ancestor-or-self::node [@alias = '$propertyAlias']" />
<xsl:value-of select="$myImage"/> // empty
Neehouse wrote a great text on how to access properties recursively from within XSLT, on the old forum:
http://forum.umbraco.org/yaf_postst2751_XSLT-Tip--Display-a-field-recursively.aspx
And you could also use a dollar sign instead of # in the macro call, se here:
http://umbraco.org/23904
<umbraco:macro alias="RenderProperties" pagevalue="[#bodyText]" runat="server"/>
Insert page value: [#propertyAlias]
Insert recursive page value: [$propertyAlias]
Insert cookie value: [%cokieValueKey]
Insert value from request collection: [@requestValueKey]
thanks Daniel, really speedy response. Posted and fixed in 5mins.
<umbraco:Macro propertyAlias="[$imageFront]" altText="alt" imageWidth="400" imageHeight="400" Alias="Image" runat="server"></umbraco:Macro
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Get recursive value in marco
i have a content picker property 'imageFront' that i wish to retrive in my xslt. I wish to choose the closest ancestor
ie so this works as page field
<umbraco:Item field="imageFront" recursive="true" runat="server"></umbraco:Item> // 1401
How would i get this value '1401' into my macro. I heard you can use #. Where would this live
My XSLT macro
<umbraco:Macro propertyAlias="imageFront" altText="alt" imageWidth="400" imageHeight="400" Alias="Image" runat="server"></umbraco:Macro
I've also tried just looking up by ancestor, but it's empty.
<xsl:variable name="myImage" select="$currentPage/ancestor-or-self::node [@alias = '$propertyAlias']" />
<xsl:value-of select="$myImage"/> // empty
Neehouse wrote a great text on how to access properties recursively from within XSLT, on the old forum:
http://forum.umbraco.org/yaf_postst2751_XSLT-Tip--Display-a-field-recursively.aspx
And you could also use a dollar sign instead of # in the macro call, se here:
http://umbraco.org/23904
Example:
<umbraco:macro alias="RenderProperties" pagevalue="[#bodyText]" runat="server"/>
Syntax:
Insert page value: [#propertyAlias]
Insert recursive page value: [$propertyAlias]
Insert cookie value: [%cokieValueKey]
Insert value from request collection: [@requestValueKey]
thanks Daniel, really speedy response. Posted and fixed in 5mins.
<umbraco:Macro propertyAlias="[$imageFront]" altText="alt" imageWidth="400" imageHeight="400" Alias="Image" runat="server"></umbraco:Macro
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.