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.
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:
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?
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.
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' :)
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
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?
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.
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...:)
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 ?
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..
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
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
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
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
Hi Jason
Did you get it to work?
Kind regards
Anders
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
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
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
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
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
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:
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
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
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
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
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
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
is working on a reply...