[TYPO3] Value from TS into html

Andreas Burg typo3 at andreasburg.de
Fri Sep 26 19:16:39 CEST 2008


Hello,

Denis uses the extension automaketemplate, and it just works, if you have done 
some other configurations.

@Denis
You can use constants here:
my_color = #FFFFFF
subparts.bg_color = {$my_color}

better not use HTML-Attribs to formate, use css-inline-style or better css-classes.
<td style="background:###bg_color###">

better use capital letters for markers, so you're more compatible with codes of 
other users and reading would be easier.
###BG_COLOR###

<td bgcolor="###bg_color###"> here you have no subpart-marker, it's a 
marks-marker. So don't use
subparts.bg_color < color
use
marks.bg_color < color
instead

> This way with some if else structure in TS it's possible to change TD 
> bgcolor for different pages.

I think using a condition would be easier.

A suggestion without automaketemplate:

CSS-file my-style.css:
.all-pages {background:white}
.special-page {background:red}

HTML-template my-template.html:
...snip...
<td class="###ALL###">
...snip...

TS-template-Constants:
BackAll = all-pages
BackSpc = special-page

TS-template-Setup:
temp.bg_color = TEXT
temp.bg_color.value = {$BackAll}
[globalVar = TSFE:id = 12]
[globalVar = TSFE:id = 321]
   temp.bg_color.value = {$BackSpc}
[global]
...snip...
     marks {
       ALL = temp.bg_color
   }
...snip...

and of course you'll have to include your my-style.css

Andreas


More information about the TYPO3-english mailing list