I hope someone can help. I have a pagepicker control on my homepage looking at the node staff. This node has individual bios on staff and from the homepage you can select which ones to show.
The site runs a xslt that looks up the value of the homepage pagepicker and displays the items selected.
NiceUrl() is a xslt extension method. And without going into too much details, xslt extension methods are static functions declared in a class library, which lives in the umbraco assembly and are globally available in xslt.
And the syntax for using those methods in xslt is umbraco.library:NiceUrl(). First part (before the semicolon) denotes the xslt namespace, where as the second part is the static function
umbraco.library is required and refers to one of the namespaces declared in code snippet below and will be included by default when creating an xslt through the umbraco ui.
If interested in all available umbraco.library xslt extension methods, have a look at this wiki page. (there's more extension libs, you may find them all through the wiki)
Oh, and it does format the string properly... it's the exact same url you may find on each of the document *General Properties* tab and takes into account all *non url* chars which need to be replaced for nice urls (based on settings in umbracoSettings.config)
Getting url for <a href from a page picker
Hello,
I hope someone can help. I have a pagepicker control on my homepage looking at the node staff. This node has individual bios on staff and from the homepage you can select which ones to show.
The site runs a xslt that looks up the value of the homepage pagepicker and displays the items selected.
I want to be able to insert within the anchor the url of the page.
This line gets the reference to the staff nodes:
And you can see that I am using the forname and pictureforframe nodes. However I need to link to the url from the anchor and I don't know the syntax.
Thanks.
Hi Streety,
How about
Hope this helps.
Regards,
/Dirk
Yes I tried that.
I get a firefox msgbx "Firefox doesn't know how to open this address, because the protocol (umbraco.library) isn't associated with any program."
Arrhggghhh, just made a noob mistake, need to wrap that in {}, so
will work.
Cheers,
/Dirk
Bingo!
I don't surpose you care to explain the syntax. What is NiceURL? Does it format the string properly?
Bingo!
I don't surpose you care to explain the syntax. What is NiceURL? Does it format the string properly?
no problem.
NiceUrl() is a xslt extension method. And without going into too much details, xslt extension methods are static functions declared in a class library, which lives in the umbraco assembly and are globally available in xslt.
And the syntax for using those methods in xslt is umbraco.library:NiceUrl(). First part (before the semicolon) denotes the xslt namespace, where as the second part is the static function
umbraco.library is required and refers to one of the namespaces declared in code snippet below and will be included by default when creating an xslt through the umbraco ui.
<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:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:ucomponents.cms="urn:ucomponents.cms" xmlns:ucomponents.dates="urn:ucomponents.dates" xmlns:ucomponents.io="urn:ucomponents.io" xmlns:ucomponents.media="urn:ucomponents.media" xmlns:ucomponents.members="urn:ucomponents.members" xmlns:ucomponents.nodes="urn:ucomponents.nodes" xmlns:ucomponents.search="urn:ucomponents.search" xmlns:ucomponents.strings="urn:ucomponents.strings" xmlns:ucomponents.urls="urn:ucomponents.urls" xmlns:ucomponents.xml="urn:ucomponents.xml"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ucomponents.cms ucomponents.dates ucomponents.io ucomponents.media ucomponents.members ucomponents.nodes ucomponents.search ucomponents.strings ucomponents.urls ucomponents.xml ">
If interested in all available umbraco.library xslt extension methods, have a look at this wiki page. (there's more extension libs, you may find them all through the wiki)
Cheers,
/Dirk
Oh, and it does format the string properly... it's the exact same url you may find on each of the document *General Properties* tab and takes into account all *non url* chars which need to be replaced for nice urls (based on settings in umbracoSettings.config)
Cheers,
/Dirk
Thanks Dirk.
is working on a reply...