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!
Im trying to build a simple newlist and created a document type "Newslist" with types "News" as child.
This is the xslt I use:
<div class="NewsListPane"><xsl:for-each select="$currentPage/descendant::Newslist/node"><xsl:sort select="@createDate" order="descending"/><xsl:if test="@nodeTypeAlias='News'" > <div class="NewsItem"> <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName" /></a> </div></xsl:if></xsl:for-each></div>
This doesnt produce any news. What am I doing wrong?
Hey froad,
You're using /node which no longer exists in the Umbraco 4.5 XML schema.
You should be using:
<div class="NewsListPane"><xsl:for-each select="$currentPage/*"><xsl:sort select="@createDate" order="descending"/><xsl:if test="name()='News'" > <div class="NewsItem"> <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName" /></a> </div></xsl:if></xsl:for-each></div>
Clarification: the * is a wildcard and your <xsl:if> block covers the rendering of your child News items.
HTH,
Benjamin
$currentPage/descendant::Newslist/* [@isDoc]
$currentPage/descendant::Newslist/News
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Simple For each in xslt with new schema
Hi!
Im trying to build a simple newlist and created a document type "Newslist" with types "News" as child.
This is the xslt I use:
This doesnt produce any news. What am I doing wrong?
Hey froad,
You're using /node which no longer exists in the Umbraco 4.5 XML schema.
You should be using:
Clarification: the * is a wildcard and your <xsl:if> block covers the rendering of your child News items.
HTH,
Benjamin
$currentPage/descendant::Newslist/* [@isDoc]
$currentPage/descendant::Newslist/News
is working on a reply...