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 two section news and event. Both have list of events and news so i need a macro who combined both list and display on page sort by date.
Here is my code
<xsl:template match="/"> <xsl:for-each select="$currentPage/ancestor-or-self::*/umbNewsArea/umbNewsArticle [@isDoc and string(umbracoNaviHide) != '1']"> <xsl:if test="position() <= $numberOfItems"> <li style="margin:0px; padding-right:10px; display:list-item;"> <p style="line-hieght:2.5em;"> <small> <xsl:value-of select="umbraco.library:FormatDateTime(newsdate, 'dd-MM-yyyy')"/> </small> </p> <h4> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="newsHeading"/> </a> </h4> </li> </xsl:if> </xsl:for-each> <xsl:for-each select="$currentPage/ancestor-or-self::*/EventArea/umbEventsArticle [@isDoc and string(umbracoNaviHide) != '1']"> <xsl:if test="position() <= $numberOfItems"> <li> <p style="line-hieght:2.5em;"> <small> <xsl:value-of select="date1"/> </small><br /> </p> <h4> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="articleHeading"/> </a> </h4> </li> </xsl:if> </xsl:for-each>
Hi Anil,
You will find a good otherview of how to combine both herehttp://pimpmyxslt.com/articles/match-templates-intro/
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Combined event and new section need help
i have two section news and event. Both have list of events and news so i need a macro who combined both list and display on page sort by date.
Here is my code
<xsl:template match="/">
<xsl:for-each select="$currentPage/ancestor-or-self::*/umbNewsArea/umbNewsArticle [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:if test="position() <= $numberOfItems">
<li style="margin:0px; padding-right:10px; display:list-item;">
<p style="line-hieght:2.5em;"> <small>
<xsl:value-of select="umbraco.library:FormatDateTime(newsdate, 'dd-MM-yyyy')"/>
</small>
</p>
<h4>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="newsHeading"/>
</a>
</h4>
</li>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="$currentPage/ancestor-or-self::*/EventArea/umbEventsArticle [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:if test="position() <= $numberOfItems">
<li>
<p style="line-hieght:2.5em;"> <small>
<xsl:value-of select="date1"/>
</small><br />
</p>
<h4>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="articleHeading"/>
</a>
</h4>
</li>
</xsl:if>
</xsl:for-each>
Hi Anil,
You will find a good otherview of how to combine both here
http://pimpmyxslt.com/articles/match-templates-intro/
is working on a reply...