Your xslt is based on the old xml schema, which means it would output only an empty <ul />, if it's running on a umbraco version newer or equal to v4.5 it will probably be using the new xml-schema.
Can you verify your version number (click the "About" button in Umbraco UI), and if newer than v4.5 check the value in <UseLegacyXmlSchema> in /config/umbracoSettings.config?
I installed uComponets. Used URL picker data type in my one of the document type. Made a content page from this document type for url picker and set its value to external link e.g. http://www.google.com. But now when i run the page or see preview, its not going to that page. can you help me to solve this?
extranal link on menu item using xslt and macro
One of the links of top menu is extarnal link. So for this to accomplish I searched through Forums and got solution but i am stucked.
I created document type called ExternalLink with two properties link and linkDescription. Then created a page from this document type.
Also, created xslt file called DBTopNav.xslt with following code and inserted its macro in my home page template.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<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:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary ">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="level" select="1"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::node [@level=$level]/node [string(data [@alias='umbracoNaviHide']) != '1']">
<li>
<xsl:choose>
<xsl:when test="string(./@nodeTypeAlias) = 'ExternalLink'">
<a href="{./data [@alias='link']}">
<xsl:value-of select="./data [@alias='linkDescription']"/>
</a>
</xsl:when>
<xsl:otherwise>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
But when I run the home page, I can't see menu itself.
anyone there who can help?
Hi hetaurhet,
Your xslt is based on the old xml schema, which means it would output only an empty <ul />, if it's running on a umbraco version newer or equal to v4.5 it will probably be using the new xml-schema.
Can you verify your version number (click the "About" button in Umbraco UI), and if newer than v4.5 check the value in <UseLegacyXmlSchema> in /config/umbracoSettings.config?
Regards
Jesper Hauge
yes, my umbraco version is 4.7.0. UseLegacyXmlSchema is as follows in config/umbracoSettings.config file.
<UseLegacyXmlSchema>false</UseLegacyXmlSchema>
so what I have to change now?
Hi hetaurhet,
Then you have to change the xslt to match the xml it's transforming. Try something like this:
You can read about the schemas here:
http://our.umbraco.org/wiki/reference/xslt/45-xml-schema
Regards
Jesper Hauge
You may also want to take a look at the Url Picker component in uComponents, see documentation here
http://ucomponents.codeplex.com/wikipage?title=UrlPicker
I installed uComponets. Used URL picker data type in my one of the document type. Made a content page from this document type for url picker and set its value to external link e.g. http://www.google.com. But now when i run the page or see preview, its not going to that page. can you help me to solve this?
I have to leave to see a client now but your best bet for help would be to post on the uComponents forum if you are still stuck.
See http://our.umbraco.org/projects/backoffice-extensions/ucomponents/questionssuggestions
ok... will do that
is working on a reply...