[TYPO3] automaketemplate using bodytag of template with different classes

T.M.Snyder tmsnyder at hotmail.com
Wed Aug 27 13:39:25 CEST 2008


"T.M.Snyder" <tmsnyder at hotmail.com> schrieb im Newsbeitrag 
news:mailman.1.1219493607.17127.typo3-english at lists.netfielders.de...
> Hi all,
> I am using T4.1, automaketemplate and rlmp_templateselector.
> I have 3 different templates, and I have 3 different classes in the 
> bodytags, so I can differ these templates for my styles.
> Im my template 1 there is bodytag like <body class="template1"> etc....for 
> 2 and 3
> The problem is now, that my bodytags from my templates is removed/replaces 
> just to <body>
>
> My tmplcode is like this:
> <!--- DOCUMENT_BODY -->
> <body class"=template1">
> all the stuff here...
> </body>
> <!--- DOCUMENT_BODY -->
[...]


Hi all,
#
I finally found a solution for this misterious stuff...
=)


page {
  bodyTag >
    # TEXT does NOT work here ...
  bodyTagCObject = HTML
  bodyTagCObject {
    value {
        # get the current selected template for page here
      field = tx_rlmptmplselector_main_tmpl
        # my template is named like main.html and other .html so lets remove 
".html" here, thats the class we will have in bodytag.
      substring  = 0, -5
        # wrap does _not_ work here, beause no space will be after 
"secondclass"
      noTrimWrap = |<body id="de" class="firstclass secondclass | ">|
    }
  }
}

Thats it!

Improvement welcome...!





More information about the TYPO3-english mailing list