Search

Hi there, I'm a newbie for symphony cms and not quite familiar with xsl.. I'm confuse with date comparison If I have images and would like to set the image to show between this period such as - image 1 show from '2012-09-14' till '2012-09-16' - image 2 show from '2012-09-14' till '2012-09-17' - image 3 show from '2012-09-15' till '2012-09-17' ... so on

I use $today >= $date it's not work anymore and if I use $today = $date it show only today date equal date from or date till how to check this
my code below

<xsl:variable name="date" select="show-image-from|show-image-till"/>
<xsl:choose>
<xsl:when test="$today = $date">
<xsl:variable name="slide-image" select="slideshow-image/filename"/>
<img src="{$workspace}/images/img-uploads/slideshow-images/{$slide-image}" />
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>

sorry my english not quite good :p Thank you very much

There's an utility to compare dates: Date utilities.

for debug's below: Slideshow2012-09-132012-09-14Slide 1img-01.jpg2012-09-132012-09-16Slide 2img-02.jpg

Thanks alpacaaa I will try that :)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details