Copied to clipboard

Flag this post as spam?

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


  • Alessione 3 posts 23 karma points
    Jul 27, 2010 @ 13:04
    Alessione
    0

    sub menu problem

    Hallo I'm new here and not a coder so exuse me for this silly question:

    ok i have a main menu made with a Menu prototype that work ok then i got a sidebar with 4 sub menus, this munus should list sub pages of some main pages :)

    sidebar:

    topic1

    subpage_topic1_A
    subpage_topic1_B
    subpage_topic1_C
    subpage_topic1_D

    topic2

    subpage_topic2_A
    subpage_topic2_B
    subpage_topic2_C
    subpage_topic2_D

    topic3

    subpage_topic3_A
    subpage_topic3_B
    subpage_topic3_C
    subpage_topic3_D

     

    ok topic1,topic2 and topic3 are main pages

    what i need is to have in all the pages of the site the sidebar with all the links.

    I need to create a macro tha renders in all the pages those menus

    I think it should be a costant id for the main pages and a loop that pops the sub pages but I don't know how to to this!! please help me!!

    ps. sorry 4 my english!!

     

    Ale

  • Alessione 3 posts 23 karma points
    Jul 27, 2010 @ 15:37
    Alessione
    0

    solved!

    I'have merged 2 scripts so probably it will be some mess but it works

    <!-- The fun starts here -->
    <ul>
    <xsl:variable name="myTopic" select="umbraco.library:GetXmlNodeById('1099')" />

    <xsl:for-each select="$myTopic/node">

    <li>
            <a href="{umbraco.library:NiceUrl(@id)}">
                <xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
                    <!-- we're under the item - you can do your own styling here -->
                    <xsl:attribute name="style">font-weight: bold;</xsl:attribute>
                </xsl:if>
                <xsl:value-of select="@nodeName"/>
            </a>
        </li>

    </xsl:for-each>

       

    </ul>

Please Sign in or register to post replies

Write your reply to:

Draft