[TYPO3-dev] Wrap div around own plugin

bernd wilke t3ng at bernd-wilke.net
Fri Nov 15 10:06:10 CET 2013


Am 15.11.13 09:13, schrieb Martin Koppelaar:
> @ Bernd
>
> Excuse my ignorance (please... ;-)) My TS code seems to say (as far as I
> can judge) something like 'if this list_type is my_plugin THEN wrap this'.

as you attach your .if to the tt_content.stdWrap.innerWrap.cObject this 
cObject returns only values if your condition matches.

your code seems clean, but you miss the 'invisible' definition for this 
cObject which was there before you wrote it over.
Use the TSOB!
comment your changes and see what was available. then enable your lines 
one by one and view the result in the TSOB

with your initial
tt_content.stdWrap.innerWrap.cObject = TEXT
you break the earlier
tt_content.stdWrap.innerWrap.cObject = CASE
and so no earlier wrapping can take place anymore.

a possible solution (aside from the solution I mentioned in my first 
posting) may be an override:
tt_content.stdWrap.innerWrap.cObject.override.cObject = TEXT
tt_content.stdWrap.innerWrap.cObject.override.cObject {
	// we define a wrap, so no real wrap for a value '|' neccessary
	// if we put all in this value
	value (
	         <div class="slider-wrapper">
	              <div class="slider">|</div>
	              <div class="menu-front"></div>
	              <div class="menu-button-back"></div>
	         </div>
)
	if.equals.field = list_type
	if.value = my_plugin
}
but this will lose all possibilities to wrap this plugin with your 
available frames.


> The only thing I can think of is that I am missing some kind of "ELSE".
> Because it seems that it renders nothing when it is not my plugin and it
> renders perfect when it IS my plugin.
>
> Or am I on the wrong track there ?

you need to learn the logic of the _configuration_ language typoscript.
so it reads "...script" it is no scripting _programming_ language.
so again: use the TSOB!

there is no ELSE. you need other constructs like .override, .ifempty, 
CASE, COA with .if on each entry, ...

> Something like default < blah ?
>
> @Phillip that's what I was doing with the frames ;-)
>

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



More information about the TYPO3-dev mailing list