[TYPO3-dev] stdWrap for all TLO's

Oliver Hader oh at inpublica.de
Wed Feb 13 22:23:24 CET 2008


Hi Steffen,

Steffen Kamper schrieb:
> "Martin Kutschker" <martin.kutschker-n0spam at no5pam-blackbox.net> schrieb im 
> Newsbeitrag news:mailman.1.1202933890.7254.typo3-dev at lists.netfielders.de...
>> Steffen Kamper schrieb:
>>> Hi,
>>>
>>> i really miss stdWrap for some TLOs (Top Level Objects) like plugin. as 
>>> COA, CONTENT etc already have.
>> "plugin" is an array of USER and USER_INT objects. It's up to them to 
>> provide stdWrap's for their properties.
>>
>> Masi
> 
> Hi Masi,
> 
> can you explain this with tt_news as example?
> so normally it's an USER-Object. How can i provide stdWrap to that 
> USER-Object?

There is no out-of-the box way to use stdWrap (as you initially wrote in 
your post to this thread). Developers just call $this->cObj->stdWrap 
from their plugin, e.g.

In TypoScript:
plugin.tx_myext_pi1 = USER
plugin.tx_myext_pi1 {
   userFunc = tx_myext_pi1->main
   stdWrap {
     ...
   }
}

In PHP class:
function main($content, $conf) {
   $content = $this->generateMyContent();
   if (isset($conf['stdWrap.'])) {
     $content = $this->cObj->stdWrap(
       $content,
       $conf['stdWrap.']
     );
   }
   return $content;
}


There are also some extension which "group" their stdWraps in 
TypoScript, like this as an example:

stdWrap {
   forListView {
     wrap = <div class="list">|</div>
     ...
   }
   forSingleView {
     wrap = <div class="single">|</div>
     ...
   }
   forWhatever {
     ...
   }
}

So, the data in $conf['stdWrap.'] would be in this case no valid stdWrap 
as documented in TSref. But each sub-key would be this. Having this in 
mind, means that adding the real stdWrap for USER/USER_INT might break a 
lot of extensions which might have to change most of their PHP code.

Another possibility would be to create a new TS object, e.g. "PLUGIN" 
which has the real stdWrap implemented like in COA:
plugin.tt_news = PLUGIN
plugin.tt_news {
   userFunc = tt_news->main
   stdWrap.wrap = <div>|</div>
}


olly
-- 
Oliver Hader
http://inpublica.de/




More information about the TYPO3-dev mailing list