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
Newbie here, first live site....
I have a Master Template with a few Page Templates underneath.
In the Master <body> tag I need to add an id depending on which page is loaded.
So I'm using: <body<umbraco:Macro Alias="BodyID" runat="server"></umbraco:Macro>> in the Master Template.
The home page Name is "home" so the test in the xslt is what I can't work out, I've got:-
<xsl:choose>
<xsl:when test="current()/nodeName = 'home'">
id="homePage"
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
Please help, I don't know where I'm going wrong and can't find any docs on it.
Thanks
Typical, you try it for an hour, run out of ideas, ask for help and bingo, you get it working!
It was:-
<xsl:when test="$currentPage/@nodeName = 'Home'">
Hope this helps someone else;)
Hi Craig100,
If you want to skip creating a macro for something like this, here's a thread using "inline XSLT" to do basically the same thing:
http://our.umbraco.org/forum/developers/xslt/12017-Body-ID-selector-based-on-ancestor#comment44495
/Chriztian
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How to get the pageName from Master
Newbie here, first live site....
I have a Master Template with a few Page Templates underneath.
In the Master <body> tag I need to add an id depending on which page is loaded.
So I'm using: <body<umbraco:Macro Alias="BodyID" runat="server"></umbraco:Macro>> in the Master Template.
The home page Name is "home" so the test in the xslt is what I can't work out, I've got:-
<xsl:choose>
<xsl:when test="current()/nodeName = 'home'">
id="homePage"
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
Please help, I don't know where I'm going wrong and can't find any docs on it.
Thanks
Typical, you try it for an hour, run out of ideas, ask for help and bingo, you get it working!
It was:-
<xsl:when test="$currentPage/@nodeName = 'Home'">
Hope this helps someone else;)
Hi Craig100,
If you want to skip creating a macro for something like this, here's a thread using "inline XSLT" to do basically the same thing:
http://our.umbraco.org/forum/developers/xslt/12017-Body-ID-selector-based-on-ancestor#comment44495
/Chriztian
is working on a reply...