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
I will create a related links function that list pages that contain the same tags as the current page.
How do I get all or the 10 latest pages or nodes that contain the tags from the current page.
I would like to use XSLT, since I have very bad experiences with razor. Razor seems to cause performance problems.
I have found TagsLib. But there is very little documentation on this subject. Does someone have an idea on how to go about this?
I found a good start here.
http://our.umbraco.org/forum/developers/extending-umbraco/3522-Find-related-pages-on-matching-tags
But the code bellow generates duplicates of pages. If the a node match severel tags it appends to the $news variable bellow. Does anyone know how to remove duplicates?
<xsl:variable name="news-nodes"> <xsl:for-each select="$tagList/value"> <xsl:copy-of select="$newsRoot/descendant::*[@isDoc][@nodeTypeAlias = 'NewsItem'][contains(newsTags, current())]" /> </xsl:for-each> </xsl:variable> <xsl:variable name="news" select="msxml:node-set($news-nodes)" /> <xsl:for-each select="$news/* [./@nodeName != $currentPage/@nodeName]"> <xsl:sort select="newsPublishedDate" order="descending"/> <xsl:if test ="((position() > ($page * 5)) and (position() < ((($page + 1) * 5) + 1)))"> <ul> <xsl:call-template name="WritePost"> <xsl:with-param name="post" select="."></xsl:with-param> </xsl:call-template> </ul> </xsl:if> </xsl:for-each>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Getting all pages containing a list of tags
I will create a related links function that list pages that contain the same tags as the current page.
How do I get all or the 10 latest pages or nodes that contain the tags from the current page.
I would like to use XSLT, since I have very bad experiences with razor. Razor seems to cause performance problems.
I have found TagsLib. But there is very little documentation on this subject. Does someone have an idea on how to go about this?
I found a good start here.
http://our.umbraco.org/forum/developers/extending-umbraco/3522-Find-related-pages-on-matching-tags
But the code bellow generates duplicates of pages. If the a node match severel tags it appends to the $news variable bellow. Does anyone know how to remove duplicates?
is working on a reply...