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
Hello,
I want the name and url of the source in "List all subpages from changeble souce"......
I am getting name but not url ....plz help me ....my code is .......
<?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"/><!-- Don't change this, but add a 'contentPicker' element to --><!-- your macro with an alias named 'source' --> <xsl:variable name="source" select="macro/source"/><xsl:template match="/"> <ul> <li> <a href="{umbraco.library:GetXmlNodeById($source)/@nodeName}"> <xsl:value-of select="umbraco.library:GetXmlNodeById($source)/@nodeName" /> </a> <xsl:apply-templates select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(umbracoNaviHide) != '1']"/> </li> </ul> </xsl:template> <xsl:template match="*[@isDoc]"> <ul> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName" /> </a> <!-- <xsl:if test="*[@isDoc][not(umbracoNaviHide = 1)]"> <ul> <xsl:apply-templates select="*[@isDoc]" /> </ul> </xsl:if> --> </li> </ul> </xsl:template> <!-- No output for these --> <xsl:template match="*[umbracoNaviHide = 1]" /></xsl:stylesheet>
Don't you just want umbraco.library:NiceUrl($source) in the first "a href"? Looks like you are using the node name as the URL.
I i do this then the url shown is something liiike this ......
http://www.domain.com/MySourceName/Texts written inside it ...........which i dont want ......
i want just ... http://www.domain.com/MySourceName
I think Rob is right, did you try:
<a href="{umbraco.library:NiceUrl($source)}">
Also can you confirm you are using the contentPicker as the macro parameter type and not contentTree?
-Tom
If i am using
then it is giving error "System.OverflowException: Value was either too large or too small for an Int32."
what to do now ?
if i am using
<a href="{umbraco.library:GetXmlNodeById($source)}">
then i get url as http://www.domain.com/Node Which I Want / Content written in side it .....
& if i am using
<a href="{umbraco.library:GetXmlNodeById($source)/@nodeName}">
then at 1st level i get proper url but when i navigate to 2nd level then i dont get proper url for 1st level node....
Yes i am using content picker ......
So please help to solve this ....
Hi valibhav
The error you describe in your latest post, does this only occour when you hit the save-button?
Try this:
<xsl:if test="$source!=''"> <a href="{umbraco.library:NiceUrl($source)}"> <xsl:value-of select="umbraco.library:GetXmlNodeById($source)/@nodeName" /> </a></xsl:if>
/Kim A
Hi Kim Andersen ,
Yes the error occures only when i hit the savo button.
Thanx kim & others , it solved my problem.
Cool, great to hear vaibhav!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Get name of source
Hello,
I want the name and url of the source in "List all subpages from changeble souce"......
I am getting name but not url ....plz help me ....my code is .......
<?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"/>
<!-- Don't change this, but add a 'contentPicker' element to -->
<!-- your macro with an alias named 'source' -->
<xsl:variable name="source" select="macro/source"/>
<xsl:template match="/">
<ul>
<li>
<a href="{umbraco.library:GetXmlNodeById($source)/@nodeName}">
<xsl:value-of select="umbraco.library:GetXmlNodeById($source)/@nodeName" />
</a>
<xsl:apply-templates select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(umbracoNaviHide) != '1']"/>
</li>
</ul>
</xsl:template>
<xsl:template match="*[@isDoc]">
<ul>
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName" />
</a>
<!-- <xsl:if test="*[@isDoc][not(umbracoNaviHide = 1)]">
<ul>
<xsl:apply-templates select="*[@isDoc]" />
</ul>
</xsl:if> -->
</li>
</ul>
</xsl:template>
<!-- No output for these -->
<xsl:template match="*[umbracoNaviHide = 1]" />
</xsl:stylesheet>
Don't you just want umbraco.library:NiceUrl($source) in the first "a href"? Looks like you are using the node name as the URL.
I i do this then the url shown is something liiike this ......
http://www.domain.com/MySourceName/Texts written inside it ...........which i dont want ......
i want just ... http://www.domain.com/MySourceName
I think Rob is right, did you try:
Also can you confirm you are using the contentPicker as the macro parameter type and not contentTree?
-Tom
If i am using
then it is giving error "System.OverflowException: Value was either too large or too small for an Int32."
what to do now ?
if i am using
then i get url as http://www.domain.com/Node Which I Want / Content written in side it .....
& if i am using
then at 1st level i get proper url but when i navigate to 2nd level then i dont get proper url for 1st level node....
Yes i am using content picker ......
So please help to solve this ....
Hi valibhav
The error you describe in your latest post, does this only occour when you hit the save-button?
Try this:
/Kim A
Hi Kim Andersen ,
Yes the error occures only when i hit the savo button.
Thanx kim & others , it solved my problem.
Cool, great to hear vaibhav!
/Kim A
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.