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
Being new to XSLT and Umbraco... I am having difficulty trying to not show a news article after it is past the current date.
Here is the code I am using to show my news list...
<xsl:if test="$numberOfItems > 0"> <ul id="newsList"> <xsl:for-each select="$articlePages"> <xsl:sort select="articleDate" order="ascending"/> <xsl:if test="position() > $recordsPerPage * number($pageNumber) and position() <= number($recordsPerPage * number($pageNumber) + $recordsPerPage )"> <li> <h3> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </h3> <p class="articleDate"> <xsl:value-of select="umbraco.library:FormatDateTime(articleDate,'dd MMMM yyyy')"/> </p> <p> <xsl:value-of select="articleSummary"/> </p> </li> </xsl:if> </xsl:for-each> </ul> <xsl:if test="$numberOfItems > $recordsPerPage"> <p id="pager"> <xsl:call-template name="pageNumbers"> <xsl:with-param name="pageIndex" select="1"/> </xsl:call-template> </p> </xsl:if> </xsl:if>
I have tried entering an if statement like this...
<xsl:variable name="expireDate" select="umbraco.library:FormatDateTime(articleDate,'yyyyMMDD')"/> <xsl:variable name="currentDate" select="umbraco.library:FormatDateTime(umbraco.library:CurrentDate(),'yyyyMMDD')"/> <xsl:if test="$currentDate > $expireDate"> </xsl:if>
Now this doesn't error or anything, it just doesn't do anything. I know I am missing something simple or thinking of this the wrong way.
Any help would be greatly appreciated.
~Tony
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Making a news list not show page past set article date
Being new to XSLT and Umbraco... I am having difficulty trying to not show a news article after it is past the current date.
Here is the code I am using to show my news list...
<xsl:if test="$numberOfItems > 0">
<ul id="newsList">
<xsl:for-each select="$articlePages">
<xsl:sort select="articleDate" order="ascending"/>
<xsl:if test="position() > $recordsPerPage * number($pageNumber) and
position() <= number($recordsPerPage * number($pageNumber) +
$recordsPerPage )">
<li>
<h3>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</h3>
<p class="articleDate">
<xsl:value-of select="umbraco.library:FormatDateTime(articleDate,'dd MMMM yyyy')"/>
</p>
<p>
<xsl:value-of select="articleSummary"/>
</p>
</li>
</xsl:if>
</xsl:for-each>
</ul>
<xsl:if test="$numberOfItems > $recordsPerPage">
<p id="pager">
<xsl:call-template name="pageNumbers">
<xsl:with-param name="pageIndex" select="1"/>
</xsl:call-template>
</p>
</xsl:if>
</xsl:if>
I have tried entering an if statement like this...
<xsl:variable name="expireDate" select="umbraco.library:FormatDateTime(articleDate,'yyyyMMDD')"/>
<xsl:variable name="currentDate" select="umbraco.library:FormatDateTime(umbraco.library:CurrentDate(),'yyyyMMDD')"/>
<xsl:if test="$currentDate > $expireDate">
</xsl:if>
Now this doesn't error or anything, it just doesn't do anything. I know I am missing something simple or thinking of this the wrong way.
Any help would be greatly appreciated.
~Tony
is working on a reply...