[TYPO3-dev] Tip: How to set module template for own module
Tapio Markula
tapio.markula at xetpoint.fi
Mon Aug 4 17:09:43 CEST 2008
Steffen Kamper
>>
>> I know that but default modules don't support the method you described
>> - that can be applied only XCLASSed core modules or your own modules :(.
>
> that's not true.
> Example: lowlevel/config
>
> You can use a different template by defining:
>
> $GLOBALS['TBE_STYLES']['htmlTemplates']['templates/config.html'] =
> 'fileadmin/templates/new_config.html';
>
> you only have to look for the name is used to set template:
> $this->doc->setModuleTemplate('templates/config.html');
If I just set in ext_tables.php
$GLOBALS['TBE_STYLES']['htmlTemplates']['templates/config.html'] =
'../'.t3lib_extMgm::extRelPath('myplugin').'xxx';
that would not work in all circumstances
XCLASSed /mod1/index.php of templavoila (tm_tvpagemodule) use this hack
$this->doc->setModuleTemplate(t3lib_extMgm::extRelPath('tm_tvpagemodule').'htmlTemplates/tv_layout.html');
if ($this->doc->moduleTemplate == '') {
$this->doc->setModuleTemplate('../' .
t3lib_extMgm::extRelPath('tm_tvpagemodule').'htmlTemplates/tv_layout.html');
}
But I can't use that kind of hack in ext_tables.php
I know that setting module templates doesn't work always ok - I have bad
experiences on it!
More information about the TYPO3-dev
mailing list