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 have Umbraco 4.0.4.2. I'm trying to use the tags datatype, using the basic xslt from the site map.
The site has this structure:
-Articles
-Article 1 ;has a tag "Arts"
-Article 2 ;has a tag "Science"
-Categories
-Arts ;clicking here will list all articles that has "Arts" tag
-Science ;clicking here will list all articles that has "Science" tag
So I'd insert a macro under Categories\Arts and it will search everything under Articles and list the ones that has 'arts' tag.
<xsl:param name="currentPage"/><xsl:template match="/"><ul><xsl:apply-templates select="$currentPage/node" /></ul></xsl:template>
<xsl:template match="node"><li><a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName" /></a></li></xsl:template>
<xsl:template match="node[data[@alias = 'umbracoNaviHide'] = 1]" />
How do I get the xslt to point to the Articles node and start grabbing all articles, and sort it out by the specified tags?
Nevermind this, I figured it out by using this:
<xsl:param name="ArticleNode" select="umbraco.library:GetXmlNodeById(1000)" /> <xsl:param name="dTags" select="/macro/pTags" /> <xsl:template match="/"> <ul> <xsl:for-each select="$ArticleNode/node [string(data [@alias = 'umbracoNaviHide']) != '1' and contains(data[@alias='pageTags'], $dTags)]"> <xsl:sort select="@updateDate" order="descending"/> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul> </xsl:template>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
How do I use tags?
I have Umbraco 4.0.4.2. I'm trying to use the tags datatype, using the basic xslt from the site map.
The site has this structure:
-Articles
-Article 1 ;has a tag "Arts"
-Article 2 ;has a tag "Science"
-Categories
-Arts ;clicking here will list all articles that has "Arts" tag
-Science ;clicking here will list all articles that has "Science" tag
So I'd insert a macro under Categories\Arts and it will search everything under Articles and list the ones that has 'arts' tag.
How do I get the xslt to point to the Articles node and start grabbing all articles, and sort it out by the specified tags?
Nevermind this, I figured it out by using this:
<xsl:param name="ArticleNode" select="umbraco.library:GetXmlNodeById(1000)" />
<xsl:param name="dTags" select="/macro/pTags" />
<xsl:template match="/">
<ul>
<xsl:for-each select="$ArticleNode/node [string(data [@alias = 'umbracoNaviHide']) != '1' and contains(data[@alias='pageTags'], $dTags)]">
<xsl:sort select="@updateDate" order="descending"/>
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
is working on a reply...