[TYPO3-ect] lib/div: parsing cObj-bodytext

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Mon Jun 4 11:17:03 CEST 2007


Am Sat, 02 Jun 2007 01:00:40 +0200 schrieb Jochen Rau:

> Hello,
> 
> I want to realize a parser for text of cObjects with lib/div to 
> auto-generate a glossary e.g.. The parser is called with
> 
> tt_content.text.20.postUserFunc = tx_contagged_controllers_parse->main
> tt_content.text.20.postUserFunc < plugin.tx_contagged.configurations
> 
> For this part of the extension, I don't need a view, because the content
> should be processed directly (the list-plugin already works fine).
> 
> How can I access the bodytext of cObj the best way? The following 
> solution seems not to be very clever (it's too late now ;-) ).
> 
> $out = $this->parameters->controller->cObj->data['bodytext'];
> 
> The bodytext should be parsed through the parseFunc_RTE. I've managed
> this by making a local_cObj:
> 
> $local_cObj = tx_div::makeInstance('tslib_cObj');
> $out = $local_cObj->parseFunc($out,$conf,'< lib.parseFunc_RTE');
> 
> Is there a solution to do this via lib/div?
> 
> Regards
> Jochen

Hi Jochen,

thanks for you input. It shows us, that it makes sense, to do something
with the first parameter to main() also in the lib controller.

We also need to give a more comfortable access to the "environment",
that's the cObj and the $GLOBALAS['FE'].

I think your approach is a fine solution for now. 

A little more direct? Maybe this works for you:

$out = $this->controller->cObj->data['bodytext'];

instead of

$out = $this->parameters->controller->cObj->data['bodytext'];

Regards,

Elmar


More information about the TYPO3-team-extension-coordination mailing list