Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andraž 45 posts 65 karma points
    Jan 12, 2010 @ 00:55
    Andraž
    0

    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

  • indula 2 posts 22 karma points
    Jan 12, 2010 @ 04:11
    indula
    0

    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

  • Andraž 45 posts 65 karma points
    Jan 12, 2010 @ 10:03
    Andraž
    0

    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

  • Dirk De Grave 4532 posts 5977 karma points MVP 3x admin
    Jan 12, 2010 @ 10:28
    Dirk De Grave
    0

    You just create a new css class ("selected" in example) in your css file and add all style properties on that css element.

    .selected { background-color: ffffff; }

     

    Cheers,

    /Dirk

  • Andraž 45 posts 65 karma points
    Jan 12, 2010 @ 12:28
    Andraž
    0

    still doesn't work

    i have this

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <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?

  • Dirk De Grave 4532 posts 5977 karma points MVP 3x admin
    Jan 12, 2010 @ 12:35
    Dirk De Grave
    0

    Asking the obvious: Have included the stylesheet in your (master)template? How does the output look like?

    Cheers,

    /Dirk

  • Andraž 45 posts 65 karma points
    Jan 12, 2010 @ 13:30
    Andraž
    0

    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

     

  • Andraž 45 posts 65 karma points
    Jan 13, 2010 @ 13:45
    Andraž
    0

    Any suggestion?

    By

    A,

  • Luke Johnson 61 posts 80 karma points
    Jun 27, 2011 @ 19:16
Please Sign in or register to post replies

Write your reply to:

Draft