[TYPO3-dev] BE lib

Steffen Kamper steffen at dislabs.de
Tue May 15 15:46:51 CEST 2007


"Ingo Renner" <typo3 at ingo-renner.com> schrieb im Newsbeitrag 
news:mailman.1.1179234671.7806.typo3-dev at lists.netfielders.de...
> Popy wrote:
>> The main difficulty to have the TS or a cObject is that you must 
>> initialise
>> a TSFE
>
> if you only need it to get some TS value this can be done way shorter:
>
>
> // get the current page ID
> $thePageId = $params['row']['pid'];
>
> $template = t3lib_div::makeInstance('t3lib_tsparser_ext');
> // do not log time-performance information
> $template->tt_track = 0;
> $template->init();
> $sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
> $rootLine = $sys_page->getRootLine($thePageId);
> // generate the constants/config + hierarchy info for the template.
> $template->runThroughTemplates($rootLine);
> $template->generateConfig();
>
> // get value for the path containing the template files
> $readPath = t3lib_div::getFileAbsFileName(
> $template->setup['plugin.']['tx_ttaddress_pi1.']['templatePath']
> );
>
>
> Ingo

Hi Ingo,

i got a little easier snippet for that, look this:

$pS = t3lib_div::makeInstance('t3lib_pageSelect');
tslib_fe::includeTCA();
$tmlp = t3lib_div::makeInstance('t3lib_TStemplate');
$tmlp->init();
$tmlp->start($pS->getRootline(intval($_GET['pid'])));
$var = $tmlp->setup['plugin.']['tx_name_pi1.']['varpath.']['var'];

this should work also, what do you think ?

vg  Steffen 






More information about the TYPO3-dev mailing list