I'am not sure if this is the right theme for this question, but anyway....does someone have any example how to make the selected link diffrent if you're using xslt for navigation?
I now how to do it with normal stitic(html) site but how to do it if you're using macro (xslt) ?
Selected Link
Hello,
I'am not sure if this is the right theme for this question, but anyway....does someone have any example how to make the selected link diffrent if you're using xslt for navigation?
I now how to do it with normal stitic(html) site but how to do it if you're using macro (xslt) ?
Tnx
Andra
You could try something like
<xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
<xsl:attribute name="class">
<xsl:text>
selected
</xsl:text>
</xsl:attribute>
</xsl:if>
install runaway or Creative website starter kit to see how everything is linked
hy,
i have this but where do i set-up the property, like "background:"ffffff;" ? Which .class do i refer to in css file?
By
You just create a new css class ("selected" in example) in your css file and add all style properties on that css element.
Cheers,
/Dirk
still doesn't work
i have this
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<ul id="nav">
<xsl:for-each select="$currentPage/ancestor::root/node [string(./data [@alias='umbracoNaviHide']) != '1']">
<li>
<xsl:if test="$currentPage/@id=current()/@id">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
<xsl:for-each select="$currentPage/ancestor-or-self::node [@level=1]/node [string(./data [@alias='umbracoNaviHide']) != '1']">
<li>
<xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
And i added a class .selected to my css. Is anything missing?
Asking the obvious: Have included the stylesheet in your (master)template? How does the output look like?
Cheers,
/Dirk
I have a link to sylesheet in my (master) template. And in that sytlesheet i added class .selected.
Otherwise my template looks:
<div id="top">
<div id="header"">
<umbraco:Macro Alias="top_navigation" runat="server"></umbraco:Macro>
http://www.simprisk.com/vsebina.aspx
by
Any suggestion?
By
A,
A solution seems to have been found here: http://wifi.umbraco.org/forum/core/general/15423-Link-Class-Selected-Page
is working on a reply...