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 this code: but no matter the doc type it just puts the "otherwise" class on it.
<a href="#"> <xsl:choose> <xsl:when test="@nodeTypeAlias='Produkt'"> <xsl:attribute name="class">product </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="class">product lagervarer</xsl:attribute> </xsl:otherwise> </xsl:choose> </a>
Here is the whole xslt:
<?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:PS.XSLTsearch="urn:PS.XSLTsearch" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets PS.XSLTsearch "><xsl:output method="xml" omit-xml-declaration="yes"/><xsl:param name="currentPage"/><xsl:template match="/"><xsl:for-each select="umbraco.library:GetXmlAll()/descendant-or-self::* [@isDoc][string(featured) = '1' ]"> <a href="#"> <xsl:choose> <xsl:when test="@nodeTypeAlias='Produkt'"> <xsl:attribute name="class">product </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="class">product lagervarer</xsl:attribute> </xsl:otherwise> </xsl:choose> <span class="prodImg"><img src="billeder/ask2.jpg" width="274" height="198" alt="Ask" /></span> <span class="ribbon">Lagervarer</span> <span class="caption"> <p>Ask #2</p> <p class="info">Mere info</p> </span> </a> </xsl:for-each></xsl:template></xsl:stylesheet>
It finds the node perfect, but my choose is wrong - what do i do wrong? :)
Hi Daniel,
There is no more @nodeTypeAlias as of 4.5
Try:
<xsl:when test="local-name() = 'Produkt'">
More info: http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/no-more-@nodetypealias
-Tom
Thanks Tom - were trying with name but didn't work. :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Choose when
I have this code: but no matter the doc type it just puts the "otherwise" class on it.
Here is the whole xslt:
It finds the node perfect, but my choose is wrong - what do i do wrong? :)
Hi Daniel,
There is no more @nodeTypeAlias as of 4.5
Try:
More info: http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/no-more-@nodetypealias
-Tom
Thanks Tom - were trying with name but didn't work. :-)
is working on a reply...