Copied to clipboard

Flag this post as spam?

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

  • Michael Jensen 7 posts 77 karma points
    Sep 07, 2023 @ 11:53
    Michael  Jensen

    Top Navigation whit subpages shown


    Site information: Version Umbraco version 7.15.10 assembly: 1.0.8321.19798 iam a ware that it is a old version but it is not posible to opgrade server to handel version 8 ore up.

    iam making at page for our local town.

    i hvae design up the page in html and it looks god now the hard part..

    my meny is like this in html:

    <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Landsbyrådet</a>
                    <ul class="dropdown-menu">
                                                    <a href="#" class="dropdown-toggle">Om Landsbyrådet</a>
                                                    <a href="#" class="dropdown-toggle">Mødedatoer</a>
                                                    <a href="#" class="dropdown-toggle">Engagementer</a>
                                                    <a href="#" class="dropdown-toggle">Referateter</a>
                                                    <a href="#" class="dropdown-toggle">Kontakt</a>

    nad loks like this

    i have this topnavigation macro. i use to use. but i cant figer out how to get it to sho the subpages..

    as you se them her..

    i love to get it to be lige mya html but i cant get my head around it

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
        xmlns:umbraco.library="urn:umbraco.library" xmlns:Examine="urn:Examine" 
        exclude-result-prefixes="msxml umbraco.library Examine ">
    <xsl:output method="xml" omit-xml-declaration="yes" />
    <xsl:param name="currentPage"/>
    <!-- Input the documenttype you want here -->
    <!-- Typically '1' for topnavigtaion and '2' for 2nd level -->
    <!-- Use div elements around this macro combined with css -->
    <!-- for styling the navigation -->
    <xsl:variable name="level" select="1"/>
    <xsl:template match="/">
    <!-- The fun starts here -->
    <ul class="nav navbar-nav navbar-left">
            <a href="/" class="">Forside</a>
        <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
            <li class="dropdown">
                <a href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id">
                        <!-- we're under the item - you can do your own styling here -->
                        <xsl:attribute name="class">active</xsl:attribute>
                    <xsl:value-of select="@nodeName"/>
                <ul class="dropdown-menu">
  • Michael Jensen 7 posts 77 karma points
    Sep 16, 2023 @ 06:47
    Michael  Jensen

    is thear eny one thar can help me. ?

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Sep 16, 2023 @ 08:18
    Chriztian Steinmeier

    Hi Michael,

    I wrote a bunch of XSLT once to help with this that you might find useful:

    Alternatively, could you maybe post the general structure of the completed HTML that you need to generate? (Starting from the <ul class="nav (etc.)">)


Please Sign in or register to post replies

Write your reply to: