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
    0

    Top Navigation whit subpages shown

    Hey.

    Site information: http://mosbjergtolne.dk.web12.curanetserver.dk/ 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">
                                    <li>
                                                    <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>
                                    </li>
                    </ul>
    </li>
    

    nad loks like this https://i.imgur.com/hpvsa7S.png

    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.. https://i.imgur.com/kyCNsKj.png

    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;"> ]>
    <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" 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">
        <li>
            <a href="/" class="">Forside</a>
        </li>
        <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:if>
                    <xsl:value-of select="@nodeName"/>
                </a>
                <ul class="dropdown-menu">
                </ul>
            </li>
        </xsl:for-each>
    </ul>
    
    </xsl:template>
    
    </xsl:stylesheet>
    
  • Michael Jensen 7 posts 77 karma points
    Sep 16, 2023 @ 06:47
    Michael  Jensen
    0

    is thear eny one thar can help me. ?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Sep 16, 2023 @ 08:18
    Chriztian Steinmeier
    0

    Hi Michael,

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

    https://github.com/greystate/Greystate-XSLT-Helpers/tree/master/navigationhelper

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

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft