[TYPO3] seasonal content

Bas van der Togt b.vandertogt at profinit.com
Wed Nov 1 23:54:53 CET 2006


I'd like to use this script to show a different image every season.
Can somebody explain me how to do this?

- Upload php file to the fileadmin
- add typoscript to setup

[userFunc = user_isSeason(4)]
temp.Image = IMAGE
temp.Image {
   file = fileadmin/templates/images/image_winter.jpg
   file.width = 800
   file.height = 250
}
[end]

etc etc

But what now?

cheers,
Bas

Bernhard Kraft schreef:
> Lee M. Childress wrote:
>> I know you can set an expiration date for content, BUT ... what if I want seasonal content? Let's say
>> I want content to show up EACH year from May to September. What would be a good way to implement that?
> 
> You can do that using userFunc conditions ...
> 
> ad the follwing php-user-func object to your fileadmin/ dir or elsewher where it is accesible for T3:
> 
> http://think-open.org/kraftb/index/class.tx_season.php.txt
> 
> (of course you must rename it to .php - remove the .txt ending which i added so you can see the source)
> 
> and then you can have conditions like:
> 
> [userFunc = user_isSeason(3)]
> 
> where
> 1 = spring
> 2 = summer
> 3 = autumn
> 4 = winter
> 
> ... as you see from the top of the php file there is a table defining start and stop of each season exactly.
> this is taken from :
> 
> http://de.wikipedia.org/wiki/Jahreszeiten#Beginn_der_Jahreszeiten
> 
> and valid till 2014 :)
> 
> "candiate for static info tables" : Seasons
> 
> greets,
> Bernhard



More information about the TYPO3-english mailing list