[TYPO3-english] wrap div around 2 content elements

Stephen Bungert stephenbungert at yahoo.de
Wed Dec 7 13:55:47 CET 2011


I always do something like this: (may not be the best way!)

temp.objectName = COA
temp.objectName {
  10 = TEXT
  10 {
    # ... TS goes here
  }
  20 = TEXT
  20 {
    # ... TS goes here
  }

  #.... more objects if requried

  wrap = <div class="someClass">|</div>
}

"Muriel le Pair" <typo3 at strangefruit.nl> schrieb im Newsbeitrag 
news:mailman.1.1323259319.10355.typo3-english at lists.typo3.org...
> Hi,
>
> I need a text with media element, only that does not exist.
> Therefor I am trying to enclose two elements with one div.
>
> <div id="test1">
>    text element
>    media element
> </div>
>
>
> I tried to solve it like this
> (so the text text element prints they first part: outerWrap = <div 
> id="test1"> |, and the div is close by the media element):
>
> tt_content {
>
>   text {
>     20 {
>       # remove standard datawrap of all text elements
>       dataWrap = |
>       stdWrap {
>         # add div to normal col, leave others blank
>         outerWrap = <div id="test1"> |
>         outerWrap.if {
>           equals.field = colPos
>           value = 0
>         }
>         removeBadHTML = 0
>       }
>     }
>   }
>   media {
>    20 {
>       stdWrap {
>         # add div to normal col, leave others blank
>         outerWrap = |</div>
>         outerWrap.if {
>           equals.field = colPos
>           value = 0
>         }
>       }
>     }
>   }
> }
>
> Nice try, but it doesn't work. TYPO3 automatically closes the first div 
> (text element) in the outerWrap, and leaves the second one (media element) 
> untouched.
>
> So the result is:
> <div id="test1"><p class="bodytext"></p></div></div>
>
> Does anybody know how to disable the automatic "correction" of the 
> outerWrap html? Or a way to wrap 2 different content elements with one 
> div?
>
> --
> kind regards,
>
> Muriel le Pair
>
> 




More information about the TYPO3-english mailing list