[TYPO3] generate page.bodyTag with userfunc

P H Vetch paul at qedstudio.com
Fri Dec 23 12:07:55 CET 2005


Sorry, my message was a bit cryptic.  What I want to be able to do is add a
random classname on the body tag chosen from an array.  At the moment I'm
faking it: I have the classes set as constants and I use conditions to
select a different class based on the minute of the hour.  It basically
works, but it's a fudge, and a nicer way would be to be able to set the
constants then call a userfunction to pick one at random.  As I see it the
key problem is that I can't figure out how to get the generated class into
the bodyTag using page.bodyTag.  

Maybe the solution is to somehow generate a constant with the userfunc,
since I know that page.bodyTag = <body class="{$myConstant}"> would work.
But I'm reaching the limits of my Typo3 knowledge here!  I certainly have no
idea how I could generate / replace a constant value with a php function.
I've had a look at what the image rotation scripts are doing but nothing
there will help me I think.  Can anyone help?

P





> -----Original Message-----
> From: typo3-english-bounces at lists.netfielders.de 
> [mailto:typo3-english-bounces at lists.netfielders.de] On Behalf 
> Of P H Vetch
> Sent: 23 December 2005 09:56
> To: typo3-english at lists.netfielders.de
> Subject: [TYPO3] generate page.bodyTag with userfunc
> 
> Hi all,
>  
> I have a very simple userfunc to pull a random classname from 
> an array and I need to get the value into the page.bodyTag.  
> My preferred method was to use postuserfunc with str_replace 
> and a marker, so <body class="###COLOUR###">, but it seems 
> the first hurdle is to figure out how to use a userfunc with 
> page.bodyTag - can it be done even?
>  
> Cheers
>  
> Paul Vetch
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english




More information about the TYPO3-english mailing list