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 use to do it before but on this new site i can't get it to work.Here is the site tree:
Content |- Site Content |- Home |- Page 1 |- Page 2 |- Folder 1
Looks kind of ugly but the reason "the Site Content" node exist is that "Editors" can start from there, without access to the "Content" node.
"Site Content" has it's "umbracoInternalRedirectId" set to the "Home" node id, so when users go to "domain.com" they endup on the "Home" node.
"Home" has a property called "siteLogo" of type upload.
Finally, the xslt i'm using to get the logo that is not working, it's always returns empty:
<xsl:variable name="logo" select="$currentPage/ancestor-or-self::node[data[@alias = 'siteLogo']][1]/data[@alias='siteLogo']" />
However, if i use this inside a template a get the siteLogo value:
<umbraco:Item field="siteLogo" recursive="true" runat="server"></umbraco:Item>
The reason i'd like to get it from a macro is because i also will set the "alt" and "title" attributes conditionally.
Oi forgot to say i was using 4.1 RC.I made a few changes and got it working on all pages except from the "Home", no matter wich level i enter on "$minLevel", it will never appears on the home page.
<xsl:variable name="minLevel" select="1"/><xsl:variable name="logo" select="$currentPage/ancestor::* [@level >= $minLevel]/siteLogo "/>
oh man, xslt is always a problem for me :-)This time i forgot to add "-or-self", now it's working like a charm:
<xsl:variable name="minLevel" select="1"/><xsl:variable name="logo" select="$currentPage/ancestor-or-self::* [@level >= $minLevel]/siteLogo "/>
Here a doc that helped me understand the new xslt schema:
http://our.umbraco.org/wiki/reference/xslt/41-xml-schema/xslt-examples-updated-to-new-schema
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
Recursive value won't work on macro
I use to do it before but on this new site i can't get it to work.
Here is the site tree:
Looks kind of ugly but the reason "the Site Content" node exist is that "Editors" can start from there, without access to the "Content" node.
"Site Content" has it's "umbracoInternalRedirectId" set to the "Home" node id, so when users go to "domain.com" they endup on the "Home" node.
"Home" has a property called "siteLogo" of type upload.
Finally, the xslt i'm using to get the logo that is not working, it's always returns empty:
However, if i use this inside a template a get the siteLogo value:
The reason i'd like to get it from a macro is because i also will set the "alt" and "title" attributes conditionally.
Oi forgot to say i was using 4.1 RC.
I made a few changes and got it working on all pages except from the "Home", no matter wich level i enter on "$minLevel", it will never appears on the home page.
oh man, xslt is always a problem for me :-)
This time i forgot to add "-or-self", now it's working like a charm:
Here a doc that helped me understand the new xslt schema:
http://our.umbraco.org/wiki/reference/xslt/41-xml-schema/xslt-examples-updated-to-new-schema
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.