[TYPO3] Show after date/time condition in TS

JoH asenau info at cybercraft.de
Tue Apr 1 13:51:07 CEST 2008


> I need to insert some content before usual site content for certain
> period.
> Help me write proper TS to show HTML CE only after certain date, or
> in date range.
>
> I try this, but it does not works:
>
> page.5 = HTML
> page.5.value = <iframe >...</iframe>
> page.5.if {
>   # get current date
>   value.data = date: y-m-d
>   # start date
>   isGreaterThan = 08-04-01
>   # end date
>   isLessThan = 08-05-01
> }

You are using a real date here, but it should be a timestamp instead, since
a date is a string and not a numeric value you could compare with another.
Additionally you are using isGreaterThan and isLessThan inverted.

According to TSref the following statements are true:

.isGreaterThan = 11
.value = 10


and

.isLessThan = 10
.value = 11

So your code should be:

page.5 = HTML
page.5.value = <iframe >...</iframe>
page.5.if {
    # get current date
    value.data = date:U
    # start date
    isLessThan = ###timestamp start###
    # end date
    isGreaterThan = ###timestamp end###
}

Replace the ###timestamp xxx### markers with the appropriate timestamps.

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com
Jobs: http://www.professionals-only.com




More information about the TYPO3-english mailing list