Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tony 11 posts 31 karma points
    Jun 10, 2011 @ 21:36
    Tony
    0

    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 &gt; 0">
        <ul id="newsList">
          
          <xsl:for-each select="$articlePages">
            
            <xsl:sort select="articleDate" order="ascending"/>

            <xsl:if test="position() > $recordsPerPage * number($pageNumber) and   
            position() &lt;= number($recordsPerPage * number($pageNumber) +   
            $recordsPerPage )">
      
              <li>
                <h3>
                  <href="{umbraco.library:NiceUrl(@id)}">
                    <xsl:value-of select="@nodeName"/>
                  </a>
                </h3>
                <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">
          <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 &gt; $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

Please Sign in or register to post replies

Write your reply to:

Draft