Get pages that has a related link to the current page.
Hi,
I am hoping someone can help me out with this one. I am trying to find all the pages that has a related links to the my current page. So that's the other opposite way of its normal use.
I currently have the following code that almost does what I want, but it returns the first match multiple times:
<!-- 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="/"> <a href="/en/jobs" class="jobstitle">Jobs in <xsl:value-of select="$currentPage/@nodeName"/></a> <xsl:choose> <xsl:when test="count(umbraco.library:GetXmlNodeById($source)/*
[@isDoc and relatedAirport = $currentPage/@id and
string(umbracoNaviHide) != '1']) > 0 "> <ul class="jobslist"> <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and relatedAirport = $currentPage/@id and string(umbracoNaviHide) != '1']"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <span class="jobtitle">» <xsl:value-of select="@nodeName"/></span> </a> </li> </xsl:for-each> </ul> </xsl:when> <xsl:otherwise><ul class="jobslist"><li><span class="jobtitle">There are currently no job openings.<br /><br /> <a href="/en/jobs">» Browse all jobs</a></span></li></ul></xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>
Thanks for the effort Rik. The blog post didn't have quite what I was looking for, but eventually I got it working. Instead of storing the returned nodes in a variable I use the XPath query directly in a for-each:
<xsl:for-each select="node [data[@alias='productLists']/links/link[@link=$currentPage/@id]]"> <!-- do stuff --> </xsl:for-each>
Get pages that has a related link to the current page.
Hi,
I am hoping someone can help me out with this one. I am trying to find all the pages that has a related links to the my current page. So that's the other opposite way of its normal use.
I currently have the following code that almost does what I want, but it returns the first match multiple times:
I have tried to illustrate what I am after below:
Cheers
Bjørn Fridal
I have it for Umbraco 4.5.x :
Hi Rik,
That looks interesting, but I am not sure I can apply the same technique. At least I can't get it working.
This is an older Umbraco installation so its using the legacy xml schema.
Cheers
Bjørn Frilda
How about this blogpost?
http://blog.leekelleher.com/2009/09/08/umbraco-ultimate-picker-xslt-example/
Thanks for the effort Rik. The blog post didn't have quite what I was looking for, but eventually I got it working. Instead of storing the returned nodes in a variable I use the XPath query directly in a for-each:
is working on a reply...