Content last modified Tuesday 24 August 2021
hop to #bottom
Categories:
Author:
Current version:
1.0
About It:
Get it:
Rate it:
  • Helpful?
  • 1 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

msv_if_custom_article_date

Usage
Using this conditional tag you can compare a date specified in an article custom field with a date specified in the tag or with ‘today’.
This way you can eg. control the visibility of an article or its part according to dates.

Classification
The msv_if_custom_article_date tag is a Conditional Tag, and therefore a Container Tag, The tag will execute the contained statement if a date set in a specified custom field is greater/less/greaterequal/lessequal/equal/notequal compared to a date set in the tag.

Syntax

The tag has the following syntactic structure:

<txp:msv_if_custom_article_date> 
...your content here... 
</txp:msv_if_custom_article_date>

Attributes

  • is=“greater/less/greaterequal/lessequal/equal/notequal” (default ‘equal’)
  • date=“date in format dd.mm.yyyy” (default is today)
  • customfield=“number of a custom field with a date associated to article” (default ‘1’)
  • dateseparator=“a character that separates day, month and year in a date string” (default ‘.’)

Other notes

  • In case the specified custom field is empty, the contained statement will be executed.
  • Date in a custom field should be in format dd.mm.yyyy

Examples

*Classical ‘publish until date’ condition.*

The article will be published until date specified in the custom field number 4 (date in format ‘dd.mm.yyyy’).

<txp:msv_if_custom_article_date is="greaterequal" customfield="4">
...ArticleContent...
</txp:msv_if_custom_article_date>

*More complicated example*

The Content will be published if date specified in the custom field number 1 (date in format ‘dd-mm-yyyy’) is less than 11th November 2006 (date in format ‘dd-mm-yyyy’).

<txp:msv_if_custom_article_date is="less" customfield="1" 
dateseparator="-" date="11-11-2006">
...Content...
</txp:msv_if_custom_article_date>

Article Request Count:
Initially released:
25/9/2006
Posted here:
25 Sep 2006

You know you want to visit the Archives.
Published with Textpattern