I'm pretty much a noob at Umbraco (but not for long o:) ). My problem is that I don't know how to include the frontpage in the navigation, I'm pretty sure the solution is quit simple, but I just don't know my XSLT that well yet.
The XSLT-code for my navigation looks like this:
Can anyone og you PROs help me please, that would really save my day... Well, perhaps not, but it would make me very happy o:)
It gets a bit more complicated if you want a different style for the "current" section to be highlighted, so come back to us if you need that.
Lesley[/quote]
Hi Lesley
Thats exactly what I want, the current style should apply on the Frontpage-link too.
I did hard code it at first, but then I had trouble applying the current-style to it.
Thats why I thought the best way to do this might be to include the frontpage i a non-hardcoded way somehow?
<li>
<a href="/home.aspx">
<xsl:if test="$currentPage/@nodeName = 'Home'">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
Home
</a>
</li>
.. xsl code for building the nav links
This basically checks to see if the currentpage is a page with node name 'Home', you should off course insert your actual node name here, and the it appends a class attribute to the a link like so: <a class="selected" href="/home.aspx">
How do I include Frontpage i navigation?
Hi Umbracians
I'm pretty much a noob at Umbraco (but not for long o:) ). My problem is that I don't know how to include the frontpage in the navigation, I'm pretty sure the solution is quit simple, but I just don't know my XSLT that well yet.
The XSLT-code for my navigation looks like this:
Can anyone og you PROs help me please, that would really save my day... Well, perhaps not, but it would make me very happy o:)
Hi there and welcome to Umbraco!
Not sure if this is necessarily best practice but I normally hard-code the link to home. So you would put:
[code]
[/code]
It gets a bit more complicated if you want a different style for the "current" section to be highlighted, so come back to us if you need that.
Lesley
[quote=Lezzles]Hi there and welcome to Umbraco!
It gets a bit more complicated if you want a different style for the "current" section to be highlighted, so come back to us if you need that.
Lesley[/quote]
Hi Lesley
Thats exactly what I want, the current style should apply on the Frontpage-link too.
I did hard code it at first, but then I had trouble applying the current-style to it.
Thats why I thought the best way to do this might be to include the frontpage i a non-hardcoded way somehow?
// Mikkel
I need that, how would you do that?
You could do:
This basically checks to see if the currentpage is a page with node name 'Home', you should off course insert your actual node name here, and the it appends a class attribute to the a link like so: <a class="selected" href="/home.aspx">
Regards
Jesper Hauge
is working on a reply...