[TYPO3-dev] Tip: How to set module template for own module
Steffen Kamper
info at sk-typo3.de
Mon Aug 4 16:20:23 CEST 2008
Tapio Markula schrieb:
> Steffen Kamper kirjoitti:
>> Tapio Markula schrieb:
>>> Steffen Kamper kirjoitti:
>>>> Steffen Kamper schrieb:
>>>>> Hi,
>>>>>
>>>>> i struggled to set a own module template while using docheader.
>>>>> The problem: template.php looks in typo3/templates for the file.
>>>>>
>>>>> Here is the way that works:
>>>>>
>>>>> $GLOBALS['TBE_STYLES']['htmlTemplates']['any_identifyer'] =
>>>>> t3lib_extMgm::extRelPath('myext') . 'mod1/template.html';
>>>>> $this->doc->setModuleTemplate('any_identifyer');
>>>
>>> but that can't be applied in ext_tables.php
>>> Because ext_tables.php can use class variables.
>>>
>>> I would need to set that in ext_tables.php, which doesn't have a
>>> proper way to handle module templates :(
>>
>> you can define the templates in ext_tables and use them in the classes
>> ;-)
>
> 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');
vg Steffen
More information about the TYPO3-dev
mailing list