[TYPO3] Problem with BODY tägs

Christopher Torgalson bedlamhotel at gmail.com
Fri May 23 10:06:05 CEST 2008


On Fri, May 23, 2008 at 9:56 AM, Georg Ringer <news at ringerge.org> wrote:
> Tapio Markula wrote:
>> If the body täg has not been defined the body tag is just <body>
>> The problem is that sometimes the body tag in the template should be
>> untouched (because of certain background definitions, which are
>> different in different templates).
>
> use css!


Even to use CSS, the most flexible method is to have different body
tags on different pages. If this is to be based on user-changeable
templates, it's tricky. I dug the following code up from a post I made
in a thread called "ow to map to a body attribute?" in the Templavoila
newsgroup--in spite of the comments, it works:


# Set up the body tags:

lib.bodyTag.1 = HTML
lib.bodyTag.1.value = <body class="class_1">

lib.bodyTag.2 = HTML
lib.bodyTag.2.value = <body class="class_2">


# Totally untested code:

bodyTagCObject = CASE
bodyTagCObject {
    key.field = tx_templavoila_to

    # if key field is not set:
    default = CASE
    default {
        key.data = levelfield : -1 , tx_templavoila_next_to, slide
        1 < lib.bodyTag.1
        2 < lib.bodyTag.2
    }

    # if key field is 1:
    1  < lib.bodyTag.1

    # if key field is 2:
    2  < lib.bodyTag.2
}


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


More information about the TYPO3-english mailing list