[TYPO3] Problem with BODY tägs

Christopher Torgalson bedlamhotel at gmail.com
Fri May 23 12:58:19 CEST 2008


Hi,

On Fri, May 23, 2008 at 12:41 PM, Tapio Markula
<tapio.markula at xetpoint.fi> wrote:
> Christopher Torgalson
>>
>> If you need more flexibility, there's also this kind of thing:
>>
>> page.bodyTagCObject = HTML
>> page.bodyTagCObject {
>>     value {
>>         data = page:uid
>>         wrap = <body id="page_|">
>>     }
>> }
> I have used that but that doesn't help problem relating HTML-templates
> if you use id as the value, because CSS should be changed when new pages
> would be created.


Obviously I wasn't trying to address your specific situation since I
don't know what it is. The above would work equally well with a class
attribute.


>> I've also used this with the CASE cObject to create a number of
>> different body tags depending on the value of some field in the page
>> record or elsewhere.
>
> that could help ordinary users to define background-color - TypoScript
> templates can't be added by non-admins and copying page doesn't copy TS
> templates but color value could be saved.


See above. If you just want to provide a way of allowing your users to
set a background colour or something, I'd use the kickstarter to add a
select box containing a list of class names to the page record and use
page.bodyTagCObject to retrieve that class name. The advantage of
using a class name instead of an actual colour is that it's
extensible--you can always add more layout properties to the page
based on the class than just the colour if the need arises.

But also, see my other post in this thread (useful if you're using
templavoila templates). I've used the code there to allow users to
vary the number of columns in the page layout. They choose an option
in the page record, and the id attribute of the body element for that
page changes. This allows multiple layouts with only one HTML template
to maintain (the CSS is slightly more complex of course, but on the
whole it's a net gain in simplicity). I think I set the TS up so that
subpages to inherit a default layout, but it should also be possible,
I think, to set it up so that subpages inherited the layout of the
parent page.

-- 
Christopher Torgalson
http://www.typo3apprentice.com/


More information about the TYPO3-english mailing list