Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
At the moment im trying to get the parent name and the link to the parent page.My current code is like this
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::node/@id)" /> <a href="{parentPageUrl}"> <xsl:value-of select="$currentPage/parent::node/@nodeName" /> </a>
But sadly it dosnt work.Anyone got a solution.Thanks in advance
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*/@id)" /> <a href="{parentPageUrl}"> <xsl:value-of select="$currentPage/parent::*/@nodeName" /> </a>
the parent node will be obviously the doc type so check only through the doc-type not all the properties
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*[@isDoc]/@id)" /> <a href="{$parentPageUrl}"> <xsl:value-of select="$currentPage/parent::*[@isDoc]/@nodeName" /> </a>
Thanks, the parent page is now listet but it links to the subpage im currently on, using
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*/@id)" />
while
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*[@isDoc]/@id)" />
gives me an error
Maybe the error is elsewhere
<xsl:output method="html" omit-xml-declaration="yes" /><xsl:param name="currentPage"/><xsl:variable name="level" select="3"/><xsl:template match="/"><ul> <li style="margin:0 0 5px 0;"> <xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*[@isDoc]/@id)" /> <xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*/@id)" /> <a href="{parentPageUrl}"> <xsl:value-of select="$currentPage/parent::*/@nodeName" /> a> li><xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']"> <li style="margin:0 0 5px 0;"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> a> li>xsl:for-each>ul>xsl:template>xsl:stylesheet>
<xsl:output method="html" omit-xml-declaration="yes" /><xsl:param name="currentPage"/><!-- Input the documenttype you want here --><xsl:variable name="level" select="3"/><xsl:template match="/"><!-- The fun starts here --><ul> <li style="margin:0 0 5px 0;"> <xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*[@isDoc]/@id)" /> <a href="{$parentPageUrl}"> <xsl:value-of select="$currentPage/parent::*[@isDoc]/@nodeName" /> </a> </li><xsl:for-each select="$currentPage/ancestor-or-self::*[@isDoc and @level = $level]/*[@isDoc and string(umbracoNaviHide) != '1']"> <li style="margin:0 0 5px 0;"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li></xsl:for-each></ul></xsl:template></xsl:stylesheet>
Now everything works.Thanks Jedi masters
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get parent name and url
At the moment im trying to get the parent name and the link to the parent page.
My current code is like this
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::node/@id)" />
<a href="{parentPageUrl}">
<xsl:value-of select="$currentPage/parent::node/@nodeName" />
</a>
But sadly it dosnt work.
Anyone got a solution.
Thanks in advance
the parent node will be obviously the doc type so check only through the doc-type not all the properties
Thanks, the parent page is now listet but it links to the subpage im currently on, using
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*/@id)" />
while
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*[@isDoc]/@id)" />
gives me an error
Maybe the error is elsewhere
<xsl:output method="html" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<xsl:variable name="level" select="3"/>
<xsl:template match="/">
<ul>
<li style="margin:0 0 5px 0;">
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*[@isDoc]/@id)" />
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*/@id)" />
<a href="{parentPageUrl}">
<xsl:value-of select="$currentPage/parent::*/@nodeName" />
a>
li>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
<li style="margin:0 0 5px 0;">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
a>
li>
xsl:for-each>
ul>
xsl:template>
xsl:stylesheet>
<xsl:output method="html" omit-xml-declaration="yes" />
<xsl:param name="currentPage"/>
<!-- Input the documenttype you want here -->
<xsl:variable name="level" select="3"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<li style="margin:0 0 5px 0;">
<xsl:variable name="parentPageUrl" select="umbraco.library:NiceUrl($currentPage/parent::*[@isDoc]/@id)" />
<a href="{$parentPageUrl}">
<xsl:value-of select="$currentPage/parent::*[@isDoc]/@nodeName" />
</a>
</li>
<xsl:for-each select="$currentPage/ancestor-or-self::*[@isDoc and @level = $level]/*[@isDoc and string(umbracoNaviHide) != '1']">
<li style="margin:0 0 5px 0;">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Now everything works.
Thanks Jedi masters
is working on a reply...