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
Hi,
First off, I think Umbraco is great. Extensible, fast, etc.
But this XSLT thing is biting me everytime I even point at it. :(
Anyway, I want to define on the top node some Related Links, that need to appear on every page on the site.
So, I found this post: http://our.umbraco.org/forum/developers/xslt/3331-Related-Links-Recursive
But for some reason, it does not list the links, I added in the related links property on the top node (alias='servicesLinks')
[code]
<xsl:template match="/"> <h2>Services</h2> <!-- The fun starts here --> <ul> <xsl:for-each select="$currentPage/ancestor-or-self::node [count(data[@alias='servicesLinks']/links/link)> 0] [1] /data[@alias='servicesLinks']/links/link"> <li> <xsl:element name="a"> <xsl:if test="./@newwindow = '1'"> <xsl:attribute name="target">_blank</xsl:attribute> </xsl:if> <xsl:choose> <xsl:when test="./@type = 'external'"> <xsl:attribute name="href"> <xsl:value-of select="./@link"/> </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl(./@link)"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:value-of select="./@title"/> </xsl:element> </li> </xsl:for-each> </ul> <!-- Live Editing support for related links. --> <xsl:value-of select="umbraco.library:Item($currentPage/@id,$propertyAlias,'')" /> </xsl:template>
[/code]
All suggestions are welcome!
[code]<xsl:template match="/"> <h2>Services</h2> <!-- The fun starts here --> <ul> <xsl:for-each select="$currentPage/ancestor-or-self::node [count(data[@alias='servicesLinks']/links/link)> 0] [1] /data[@alias='servicesLinks']/links/link"> <li> <xsl:element name="a"> <xsl:if test="./@newwindow = '1'"> <xsl:attribute name="target">_blank</xsl:attribute> </xsl:if> <xsl:choose> <xsl:when test="./@type = 'external'"> <xsl:attribute name="href"> <xsl:value-of select="./@link"/> </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl(./@link)"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:value-of select="./@title"/> </xsl:element> </li> </xsl:for-each> </ul> <!-- Live Editing support for related links. --> <xsl:value-of select="umbraco.library:Item($currentPage/@id,$propertyAlias,'')" /> </xsl:template>[/code]
Aargh!!! We need an edit function!!!
I reposted this in the developers forum/xslt.
http://our.umbraco.org/forum/developers/xslt/3331-Related-Links-Recursive
nvm wrong paste
Yeah, I copied your solution, but didn't get it to work...
Strange worked here. Got some troubles with the live editing, but just deleted that functionality
This worked for me: http://our.umbraco.org/forum/developers/xslt/3638-Related-Links-recursive--how-to-get-this-to-work
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Related links, recursive... trouble
Hi,
First off, I think Umbraco is great. Extensible, fast, etc.
But this XSLT thing is biting me everytime I even point at it. :(
Anyway, I want to define on the top node some Related Links, that need to appear on every page on the site.
So, I found this post: http://our.umbraco.org/forum/developers/xslt/3331-Related-Links-Recursive
But for some reason, it does not list the links, I added in the related links property on the top node (alias='servicesLinks')
[code]
<xsl:template match="/">
<h2>Services</h2>
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::node [count(data[@alias='servicesLinks']/links/link)> 0] [1] /data[@alias='servicesLinks']/links/link">
<li>
<xsl:element name="a">
<xsl:if test="./@newwindow = '1'">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="./@type = 'external'">
<xsl:attribute name="href">
<xsl:value-of select="./@link"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:NiceUrl(./@link)"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="./@title"/>
</xsl:element>
</li>
</xsl:for-each>
</ul>
<!-- Live Editing support for related links. -->
<xsl:value-of select="umbraco.library:Item($currentPage/@id,$propertyAlias,'')" />
</xsl:template>
[/code]
All suggestions are welcome!
[code]<xsl:template match="/">
<h2>Services</h2>
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::node [count(data[@alias='servicesLinks']/links/link)> 0] [1] /data[@alias='servicesLinks']/links/link">
<li>
<xsl:element name="a">
<xsl:if test="./@newwindow = '1'">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="./@type = 'external'">
<xsl:attribute name="href">
<xsl:value-of select="./@link"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:NiceUrl(./@link)"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="./@title"/>
</xsl:element>
</li>
</xsl:for-each>
</ul>
<!-- Live Editing support for related links. -->
<xsl:value-of select="umbraco.library:Item($currentPage/@id,$propertyAlias,'')" />
</xsl:template>
[/code]
Aargh!!! We need an edit function!!!
<xsl:template match="/">
<h2>Services</h2>
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/ancestor-or-self::node [count(data[@alias='servicesLinks']/links/link)> 0] [1] /data[@alias='servicesLinks']/links/link">
<li>
<xsl:element name="a">
<xsl:if test="./@newwindow = '1'">
<xsl:attribute name="target">_blank</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="./@type = 'external'">
<xsl:attribute name="href">
<xsl:value-of select="./@link"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:NiceUrl(./@link)"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="./@title"/>
</xsl:element>
</li>
</xsl:for-each>
</ul>
<!-- Live Editing support for related links. -->
<xsl:value-of select="umbraco.library:Item($currentPage/@id,$propertyAlias,'')" />
</xsl:template>
I reposted this in the developers forum/xslt.
http://our.umbraco.org/forum/developers/xslt/3331-Related-Links-Recursive
nvm wrong paste
Yeah, I copied your solution, but didn't get it to work...
Strange worked here. Got some troubles with the live editing, but just deleted that functionality
This worked for me: http://our.umbraco.org/forum/developers/xslt/3638-Related-Links-recursive--how-to-get-this-to-work
is working on a reply...