Copied to clipboard

Flag this post as spam?

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


  • anthony hall 222 posts 536 karma points
    Dec 02, 2010 @ 19:43
    anthony hall
    0

    displaying submenu in 4.5

    In previous versions of umbraco i was umbraco to create a submenu by containing something like the following inside an outer foreach. Can i not use ./node in 4.5?


    <xsl:for-each select="./node [@nodeTypeAlias = 'Content'] [string(data [@alias='umbracoNaviHide']) != '1']">
              <li class="">          
                <a href="{umbraco.library:NiceUrl(@id)}">
                  <xsl:if test="$currentPage/@id = current()/@id">
                    <!-- we're under the item - you can do your own styling here -->
                    <xsl:attribute name="class">sel</xsl:attribute>
                  </xsl:if>
                  <xsl:value-of select="@nodeName"/>
                </a>
              </li>
            </xsl:for-each>  

  • Rich Green 2246 posts 4008 karma points
    Dec 02, 2010 @ 20:15
    Rich Green
    2

    Hey,

    There is no nodeTypeAlias any more http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/no-more-@nodetypealias

    Here is your code for 4.5 converted here http://blackpoint.dk/umbraco-workbench/tools/convert-xml-schema-to-45-.aspx?

    <xsl:for-each select="./Content [@isDoc] [string(umbracoNaviHide) != '1']">
        <li class=""> 
            <a href="{umbraco.library:NiceUrl(@id)}">
                <xsl:if test="$currentPage/@id = current()/@id">
                    <!-- we're under the item - you can do your own styling here -->
                    <xsl:attribute name="class">sel</xsl:attribute>
                </xsl:if>
                <xsl:value-of select="@nodeName"/>
            </a>
        </li>
    </xsl:for-each>

    Rich

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 02, 2010 @ 23:11
    Jan Skovgaard
    1

    Hi Anthony

    The snippet you posted looks a lot like the default XSLT snippet provided by Umbraco, so if you just choose the "navigation" snippet during creation of your XSLT file you'll get the new syntax served for you directly.

    As Rich mentions the schema has changed in version 4.5 - however if you for some reason need to use the old schema you can change it to run legacy in the umbracosettings.config file.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft