Im listing. a menu starting from a specific node id. This works great, but I want to list the node id itself (1054) and have the possibility to change style of that link compared to its children, Is it possible somehow to use a simple solution displayed below and get the node name of 1054?
I'm not totally following what you're trying to do, but to get the node properties (including node name) from a node id you can use the umbraco.library:GetXmlNodeById extension method, something like this:
Display nodename for one page.
Hi
I have a problem with displaying nodename
Im listing. a menu starting from a specific node id. This works great, but I want to list the node id itself (1054) and have the possibility to change style of that link compared to its children, Is it possible somehow to use a simple solution displayed below and get the node name of 1054?
<li> <a href="{umbraco.library:NiceUrl(1054)}"></a> </li>
BR
Gustav
example of my XSLT
<?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:Examine="urn:Examine"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets Examine ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<!-- update this variable on how deep your site map should be -->
<xsl:variable name="maxLevelForSitemap" select="3"/>
<xsl:template match="/">
<div id="sitemap">
<li>
<a href="{umbraco.library:NiceUrl(1054)}"></a>
</li>
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="umbraco.library:GetXmlNodeById(1054) "/>
</xsl:call-template>
</div>
</xsl:template>
<xsl:template name="drawNodes">
<xsl:param name="parent"/>
<xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
<ul><xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevelForSitemap]">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/></a>
<xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevelForSitemap]) > 0">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Hi
Example below is not working either...
<li>
<a href="{umbraco.library:NiceUrl(1054)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
gustav
Hi Gustav,
I'm not totally following what you're trying to do, but to get the node properties (including node name) from a node id you can use the
umbraco.library:GetXmlNodeById
extension method, something like this:Does this help?
Hi Dan
Tanks! I worked perfectly!
/Gustav
is working on a reply...