[TYPO3-dev] comments: show header only if comments allowed

Steffen Müller typo3 at t3node.com
Mon Jan 12 10:54:12 CET 2009


Hi.

On 12.01.2009 09:46 Peter Russ wrote:
>>
>> This is what I thought, too.
>> Can't we prevent this output if there's no form and no comments or is
>> this an essential thing for you that this (and empty pagebrowse tag)
>> are printed out even when there's no content?
>>
>> Steffen
> 
> +1
> Provide a patch for pibase and a option to config.
> 

A suggestion:
For backward compatibility, default is to use pi_wrapInBaseClass.
Alternatively, use stdWrap as TS configuration option if set:

+ function baseWrap($content) {
+   if (!isset($this->conf['baseWrap.'])) {
+     return $this->pi_wrapInBaseClass($content);
+   } else {
+     return $this->cObj->stdWrap($content,$this->conf['baseWrap.']);
+   }
+ }

and use this function in main() function:
- return $this->pi_wrapInBaseClass($content);
+ return $this->baseWrap($content);

Add to configuration documentation:

plugin.tx_pluginname_pi1 {
   # Remove the baseWrap div container
   baseWrap.wrap = |
}

Using static pi_wrapInBaseClass is very common in extensions. I don't
like it because it makes it hard to reuse cObjects in other extensions
(or eID). Find detailed complains on this topic in my blog:
http://www.t3node.com/blog/fe-plugins-need-configurable-basewrap-instead-of-static-pi-wrapinbaseclass/


-- 
cheers,
Steffen






More information about the TYPO3-dev mailing list