Copied to clipboard

Flag this post as spam?

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


  • Jason Mackay 98 posts 149 karma points
    Nov 30, 2011 @ 13:06
    Jason Mackay
    0

    Navigation.xslt

    Hi

    Anyone know if you can alter the Navigation.xslt so it start from a particular node Id rather than a fromLevel?

    I have a page outwith the pages in Umbraco and want it to be able to pick up the child navigation page.

    Any help is brilliant, thanks.

    Jason

  • Rune Grønkjær 1372 posts 3103 karma points
    Nov 30, 2011 @ 13:32
    Rune Grønkjær
    0

    Hi Jason,

    Navigation.xslt can do a lot of thing including what you ask. Try setting the rootPage property to the page idyou want.

    /Rune

  • Jason Mackay 98 posts 149 karma points
    Nov 30, 2011 @ 13:38
    Jason Mackay
    0

    Hi Rune

    Thanks for the reply, where is the rootPage property, is this set up already in the XSLT or do I need to set it up. Can't find it in my navigation.xslt.

    Thanks

  • Rune Grønkjær 1372 posts 3103 karma points
    Nov 30, 2011 @ 13:41
    Rune Grønkjær
    0

    You set it where the macro is inserted to your template. Just like the "navigationId" is set. You will have to mess a bit around with the other properties as well to make it act just like you want it. In the code it looks like this:

    <umbraco:Macro fromLevel="3" sort="descending" navigationId="mainmenu" numberOfLevels="1" rootPage="" showOnlyCurrentPath="1" useSelfAsRoot="0" isSitemap="0" Alias="Navigation" imageProperty="" runat="server" />

    fromLevel might need adjusting. and the "useSelfAsRoot" should be set to 1.

    /Rune

  • Anders Burla 2560 posts 8256 karma points
    Dec 03, 2011 @ 16:10
    Anders Burla
    0

    Hi Jason

    Did you get it to work?

    Kind regards
    Anders

  • Jason Mackay 98 posts 149 karma points
    Dec 03, 2011 @ 20:13
    Jason Mackay
    0

    Hi Anders,

    No I didnt manage to get it the way Rune was explaining so I just built a customise usercontrol instead to get it to work.

    Thanks for your help though.

    Jason

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Dec 08, 2011 @ 00:40
    Bjarne Fyrstenborg
    0

    Hi guys

    I noticed a thing with the navigation xslt-file from the starterkit v. 2.0.2.0 where it check if umbracoNaviHide = '0' rather than umbracoNaviHide != '1'
    But if you have a node in the content structure using a doc type, which haven't a umbracoNaviHide property, then it will not be shown in the navigation.. as soon I added the umbracoNaviHide property to that doc type it worked..

    of course mostly it can inherit from other doctypes, which have that property..

    if the xslt-file check for umbracoNaviHide != '1' the nodes will be shown in the navigation as default.. and then it's perhaps easier just to add the property if needed or use ignoreDocumentTypes="News,Product" to exclude specific doctypes?

    Bjarne 

  • Rune Grønkjær 1372 posts 3103 karma points
    Dec 08, 2011 @ 07:57
    Rune Grønkjær
    0

    Hi Bjarne,

    You are absolutely right. We do that because we assume that if you want the page to be visible in the menu, it's most probably because you can enter it, and therefor you need all the normal properties of a page. The rule is: if a node want's to be in the menu, it must inherit or implement the menu properties, so administrators can control it properly.

    /Rune

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Dec 08, 2011 @ 16:12
    Bjarne Fyrstenborg
    0

    Hi Rune

    Ahh okay.. you can do that and probably always a good idea to include the umbracoNaviHide property. Then it doesn't make any difference whether you use umbracoNaviHide = '0' or umbracoNaviHide != '1' .. I just noticed my gallery item node wasn't displayed in the menu because the xml doesn't had that property. From a newbies point of view you have to be aware on this.. that's probably why the standard Umbraco menu templates in xslt use umbracoNaviHide != '1' :)

    Bjarne

  • Anders Burla 2560 posts 8256 karma points
    Dec 08, 2011 @ 23:31
    Anders Burla
    0

    Hi Jason

    It would be great for others to easy find the "right" solution for your answer. If you could mark the right answer as a solution it would be great - thanks

    Kind regards
    Anders

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Dec 21, 2011 @ 20:50
    Bjarne Fyrstenborg
    0

    I have a question about the navigation.xsl file, cause I need to make an external link in the menu.

    A part of the xslt file has this: 

    ....
    <
    xsl:attribute name="href">
      <xsl:choose>
        <xsl:when test="local-name() != 'ExternalLink'">
          <xsl:value-of select="umbraco.library:NiceUrl(@id)" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="./externalURL" />
        </xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>
    ....

    But I can not see ExternalLink and externalURL is used anywhere?
    Right now the links will always be internal. Should I create a property with externalURL as alias? 

    Bjarne 

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 21, 2011 @ 21:56
    Jan Skovgaard
    0

    Hi Bjarne

    Maybe it always returns an internal link since the test is made on "ExternalLink" and not "externalURL" ? Or am I missing something obvious here?

    /Jan

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Dec 21, 2011 @ 22:08
    Bjarne Fyrstenborg
    0

    Hi Jan..

    Yes, I'm not shure what ExternalLink does..i have seen other posts using ExternalLink.. but it was perhaps a variable. Does Umbraco have something like ExternalLink to check if the link is external?

    I can't see it's used in the starterkit and with the properties on the doc types.. I think the links always will be internal with the properties..
    I think I need to add a property, e.g. a textstring, where I can write an external link.. and use that link.

    Bjarne 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 21, 2011 @ 22:44
    Jan Skovgaard
    0

    Hi Bjarne

    Hmm ok, yes then you should probably create a property with the alias of externalUrl that you check instead of ExternalLink. But perhaps it's a good idea to check the XML output first to see if there is in fact set something somewhere? The good old <textarea><xsl:copy-of select="." /></textarea> trick...:)

    /Jan

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Dec 22, 2011 @ 02:17
    Bjarne Fyrstenborg
    0

    Hi Jan

    It doesn't seem to have anything about ExternalLink or externalURL .. only <externalURL>http://www.google.dk</externalURL>; cause I have added that property just for testing..

    I have tried to see what local-name() gives me, and it return names like Page and NewsList ..
    So perhaps it's intended to create a doctype ExternalLink with the property externalURL ?

    Bjarne 

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Dec 22, 2011 @ 02:32
    Bjarne Fyrstenborg
    0

    Okay, I created a ExternalLink doctype with Page doctype as parent... and then added a property with alias externalURL .. 

    if I then write http://google.dk or http://www.google.dk it seem to work and open Google. but with just www.google.dk it's creating the link this way: www.domain.com/actual-page/www.google.dk

    but it's probably quick to solve.. a check if the string contains www. .. perhaps important to have the dot after www, if you want a menu containing www in the name, without make it external..

    Bjarne

     

Please Sign in or register to post replies

Write your reply to:

Draft