[TYPO3-english] Content-position specific styling in htmlArea

Loek Hilgersom hilgersom at xs4all.nl
Mon Jun 8 12:38:30 CEST 2009


Hi Erich,

Maybe you could use a field from the content records, e.g. section_frame, to 
select which id to wrap around that content element (or better, use a class 
instead of id so you can use the same styling more than once on a page if wanted).

Put this in Page TS on your root page:

TCEFORM.tt_content {
	section_frame {
		removeItems = 1,5,6,7,10,11,12,13,20,21
		addItems.30 = Layout 0
		addItems.31 = Layout 1
		addItems.32 = Layout 2
	}
}

then in your TS setup:

contentdiv.cObject = CASE
contentdiv.cObject {
	key.field = section_frame
	default < tt_content.stdWrap.wrap

	default = TEXT
	default.value = |

	30 < tt_content.stdWrap.wrap
	30 = TEXT
	30.value = <div class="layout0">|</div>

	31 < tt_content.stdWrap.wrap
	31 = TEXT
	31.value = <div class="layout1">|</div>

	32 < tt_content.stdWrap.wrap
	32 = TEXT
	32.value = <div class="layout2">|</div>
}
tt_content.stdWrap.outerWrap < contentdiv

hth,
Loek



Erich Schreiber wrote:
> Hi,
> 
> We normally use <div id="something"> ... </div> to setup different
> areas in our sites (like 'main_content', 'menu', 'footer', etc.).
> Inside of those DIVs standard HTML-tags do not use further classes and
> are configured with CSS rules like '#something strong { ... };'
> 
> E.g. We have a text-element 'Hello' and put it into header, main
> content and footer. In the frontend it will look different because of
> the different CSS rules for those locations. Just now our htmlArea
> configuration looks the same for all those cases.
> 
> How do we get htmlArea to display those different styles in dependence
> of frontend-location?
> 
> This should work in standard subpart-composition and in Templa Voilá
> with sub-templates.
> 
> Erich
> 


More information about the TYPO3-english mailing list