[TYPO3-dev] Wrap div around own plugin

bernd wilke t3ng at bernd-wilke.net
Thu Nov 14 12:04:18 CET 2013


Am 14.11.13 10:25, schrieb Martin Koppelaar:
> Hi group,
>
> I have created a plugin that produces a slider. As this slider is used
> in more templates for this template I am working on I want to wrap the
> slider from my template and not in the plugin itself.
>
> This code works:
>
> tt_content.stdWrap.innerWrap.cObject = TEXT
> tt_content.stdWrap.innerWrap.cObject {
>      value = |
>      if.equals.field = list_type
>      if.value = my_plugin
>      wrap (
>           <div class="slider-wrapper">
>                <div class="slider">|</div>
>                <div class="menu-front"></div>
>                <div class="menu-button-back"></div>
>           </div>
>      )
> }
>
> However, it breaks the div that CssStyledContent wraps around the
> object, it is removed.
>
> This is removed:
> <div id="c1309" class="hide-for-small" >
> </div>
>
> And it is not only removed from the slider plugin, it is removed from
> all other elements.
>
> As I am only beginning to learn TypoScript can someone please explain
> what I should do to achieve this:
>
> <div id="c1309" class="hide-for-small">
>      <div class="slider-wrapper">
>           [etc]
>      </div>
> </div>

as you see yourself tempering with tt_content.stdWrap.innerWrap is no 
good idea.
inspecting CSC with the TSOB (TypoScript Object Browser) you will find a 
lot of definitions beyond tt_content.stdWrap.innerWrap.cObject
and that tt_content.stdWrap.innerWrap.cObject itself is a CASE-Object 
which can't be changed easily to TEXT.

you may change the part
tt_content.stdWrap.innerWrap.cObject.default.30.cObject.default.value
to include your inner <div> but that is not copied to all other 
section_frame variants based on default.

Furthermore you may find tt_content.stdWrap.innerWrap2 which provides a 
linkToTop.
This may be changed easier.
easieast: delete current configuration and define new:

tt_content.stdWrap.innerWrap2 >
tt_content.stdWrap.innerWrap2 (
            <div class="slider-wrapper">
                 <div class="slider">|</div>
                 <div class="menu-front"></div>
                 <div class="menu-button-back"></div>
            </div>
       )
tt_content.stdWrap.innerWrap2.if {
	equals.field = list_type
	value = my_plugin
}

if you use the linkToTop you may redefine the given definition, which is 
a more complex definition again.

> For your information, the "hide-for-small" class is a indentation /
> frame change I created like this:
>
> tt_content.stdWrap.innerWrap.cObject {
>      150 < tt_content.stdWrap.innerWrap.cObject.default
>      150.15.value = hide-for-small
>      160 < tt_content.stdWrap.innerWrap.cObject.default
>      160.15.value = show-for-small
> }
>
> This class is used in the ZURB Foundation Framework for mobile use.
>
> Kind regards,
> Martin

bernd
-- 
http://www.pi-phi.de/cheatsheet.html



More information about the TYPO3-dev mailing list