[TYPO3] Content header wrapping?

Francois Suter fsuter at cobweb.ch
Wed Jan 23 14:53:42 CET 2008


Hi,

> Well, I have a design in mind looking something like:
>
> [snip]
> Is this even possible?

Short answer: yes.

> I managed to wrap the stdheader with:
> # lib.stdheader.stdWrap.outerWrap = <div class="content-header">|</div
>
> But I don't want to wrap all headers, only headers of the Content  
> element.

I'm afraid, this is unclear. lib.stdheader is indeed shared by all  
types of content elements. Why is that not good for you? Maybe you  
want on Text elements? Could you clarify please?

> I tried
> # tt_content.header.outerWrap = <div class="content-header">|</div
> But that won't work at all.

Well, it can't work, because tt_content.header is a COA which has no  
outerWrap property. It has a stdWrap.outerWrap property though...

So maybe what you mean actually is that you want only content  
elements of type Header to be wrapped?

> And then, I want to wrap the content in a separate div, underneath the
> header. This because I want to have borders 'round the actual content
> element, but not in the header. This applies to all content elements.

Fine, but you will have one difficulty: the different content  
elements do not all have the same structure. So for wrapping a Text  
content element, you can do:

tt_content.text.20.wrap = <div class="content">|</div>

For an Image content element, you need to use

tt_content.image.20.stdWrap.wrap = <div class="content">|</div>

but you will have problem with the Text + Picture content element  
type, because of the line:

tt_content.textpic.20.text.20 =< tt_content.text.20

This reference means that your <div class="content">|</div> content  
wrap will also appear again inside your textpic construct.

And since tt_content.textpic.20.text.20 is a reference, you cannot  
just remove the wrap by setting:

tt_content.textpic.20.text.20.wrap >

The solution I found was to change the reference to a copy:

tt_content.textpic.20.text.20 < tt_content.text.20

And then I could do

tt_content.textpic.20.text.20.wrap >

You will have to adapt those samples to each content element type.

And I may be wrong about the thing with the reference, but at least  
it's what I observed. Another way would be to use the stdWrap of  
tt_content.text.20 rather than the simple wrap, and use the "if"  
property to wrap only if the content element is of type text... It's  
a just thought that occurs to me now, but it may be worth a try...

HTH

François Suter

-- 
Cobweb Development Sàrl
www.cobweb.ch

Rue Eugène-Marziano 15, CH-1227 Les Acacias (Geneva - Switzerland)
T: +41 22 880 00 93, F: +41 22 880 00 94, E: support at cobweb.ch
web solutions for professionnal requirements






More information about the TYPO3-english mailing list