[TYPO3] Wrap everything but header of a content element

JoH asenau info at cybercraft.de
Sun Mar 4 12:35:24 CET 2007


>> This is not what you have been talking about and it is not what I
>> showed you in my posting.
>>
>> You said you are able to wrap the header _and_ the whole element
>> using separate headers. So what you have to do is:
>>
>> Wrap the header like this
>>
>> wrapForTheHeader =<div class="headwrap"> | </div><div
>> class="datawrap">
>>
>> and then just close the second div of this header wrap using the
>> following wrap for the whole element:
>>
>> tt_content.stdWrap.wrap = | </div>
>>
>> additional explanation:
>>
>> Something like this
>>
>> headerWrap = <header>|</header>
>> elementWrap = <element>|</element>
>>
>> will render
>>
>> <element>
>>     <header>Header</header>
>>         Element
>> </element>
>>
>> While this
>>
>> headerWrap = <header>|</header><element>
>> elementWrap = |</element>
>>
>> will render
>>
>> <header>Header</header><element>
>>         Element
>> </element>
>>
>> Got the point?
>>
>> PS: headerWrap and elementWrap are just examples that don't exist in
>> tt_content. So you should replace them with the names of the desired
>> TS parts.
>>
>
> There is a bug with this coding. If I hide the header in the backend
> with this construct I will be left with an unmatched </div> after the
> content elemet. That is what I am fixing just right now. Thank you for
> your example it started me in the right direction.

It's not a bug, it's a feature ;-)
You never asked about the handling of empty headers so I just gave you the
basic solution.

It will work when you will use "ifEmpty" on the header, so that it will wrap
like this
<header>Header</header><element>
if a header is available and like this
<element>
if the header is empty, so the closing </element> will always get a partner.

Advantage: You don't have to take care of separate wraps for each and every
type of content element/plugin, since all available elements will be wrapped
this way. (With just one exception: textpic is using some layout variants
pushing the header into the content itself, so you will have to find a
special solution for them)

HTH

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
openBC/Xing: http://www.cybercraft.de
T3 cookbook: http://www.typo3experts.com




More information about the TYPO3-english mailing list