i am using umbraco 4.7.0. I have created top navigation menu using umbraco xslt template 'list subpages by level'.
This works fine for internal url. For one of the menu item i want to give external url, so for that I am using uComponent's URL picker. I installed this package. Added one property with 'URL picker' type in document type. Made content page from this doc type and specified external link in 'url' field of URL picker.
But for this external link, menu navigation is not working. i.e. it search for page in /root folder of the web site like other internal content pages. what changes I need to do now in xslt file of top navigation menu?
Sure, there are a few ways to do this... guess I opted for the more advanced version (sorry).
"normalize-space" is an XPath function that will remove all whitespaces from a value ... along with this, if it is used as a condition (in an if/when test statement), then it will return true if the string is not empty and false if it is empty. It's pretty much the same as saying "urlpicker != ''", but takes whitespace into consideration.
The <xsl:attribute> tag, does just that... adds an attribute to the parent HTML/XML element. So in my example, it would replace the existing "href" attribute that was set.
i am using xml. and make changes u say in xslt file. the above code is also not working.....
when we use url picker... can you tell the steps of how to create external link under home page node? i am just creating content page from the doc type which has one of its property of the type 'url picker'.
i am using xml. and make changes u say in xslt file. the above code is also not working.....
when we use url picker... can you tell the steps of how to create external link under home page node? i am just creating content page from the doc type which has one of its property of the type 'url picker'.
URL picker and top navigation menu
hello
i am using umbraco 4.7.0. I have created top navigation menu using umbraco xslt template 'list subpages by level'.
This works fine for internal url. For one of the menu item i want to give external url, so for that I am using uComponent's URL picker. I installed this package. Added one property with 'URL picker' type in document type. Made content page from this doc type and specified external link in 'url' field of URL picker.
But for this external link, menu navigation is not working. i.e. it search for page in /root folder of the web site like other internal content pages. what changes I need to do now in xslt file of top navigation menu?
please its urgent......
Hi hetaurhet,
Could you post your XSLT snippet? Have you made any changes to the "list subpages by level" template?
Should only require a tweak to the <a href> to use the Url Picker instead of the NiceUrl call.
Cheers, Lee.
using 4.7.0 version.. so will need code related to this.
Hi hetaurhet,
See my example snippet. I have added a check to see if the "url" field has a value - if so, then it will use that (instead of the NiceUrl call).
Hope that makes sense?
Cheers, Lee.
no, its not working. but still can you explain me following lines from your code?
property name which i am using is urlpicker on my doc type ....
Hi hetaurhet,
Sure, there are a few ways to do this... guess I opted for the more advanced version (sorry).
"normalize-space" is an XPath function that will remove all whitespaces from a value ... along with this, if it is used as a condition (in an if/when test statement), then it will return true if the string is not empty and false if it is empty. It's pretty much the same as saying "urlpicker != ''", but takes whitespace into consideration.
The <xsl:attribute> tag, does just that... adds an attribute to the parent HTML/XML element. So in my example, it would replace the existing "href" attribute that was set.
Here's a revised code snippet for you...
Cheers, Lee.
its not going into following if statement for external link
Hi hetaurhet,
Sorry, I'd completely forgot that Url Picker uses different underlying data-sources. Which one are you using, XML or CSV?
Hopefully you are using XML. If so, then modify your XSLT like so...
There is documentation about the UrlPicker data-type on CodePlex - if you are curious about the finer details.
Cheers, Lee.
i am using xml. and make changes u say in xslt file. the above code is also not working.....
when we use url picker... can you tell the steps of how to create external link under home page node? i am just creating content page from the doc type which has one of its property of the type 'url picker'.
i am using xml. and make changes u say in xslt file. the above code is also not working.....
when we use url picker... can you tell the steps of how to create external link under home page node? i am just creating content page from the doc type which has one of its property of the type 'url picker'.
is working on a reply...