[TYPO3-dev] Get TS Setup within BE module

Krystian Szymukowicz t33k at prolabium.com
Wed Nov 3 20:28:16 CET 2010


W dniu 2010-11-03 17:17, Victor Livakovsky wrote:
> Hi,
>
> Okay, I've got the idea :) Logic at BE modules should be a bit different.
> The reason, why I asked my question, is, that I have a FE plugin with
> upload field. Files are uploaded to a folder, specified at TS as
> 'tx_myext_pi1.file.uploadPath'. And I want to give links to these files
> at BE. That's why I wanted to access TS from BE module - to make the
> path be stored in one place, not in two places: TS template AND Page TS
> config.
> But I forgot about ext settings, so I can store path there.

Anyway its useful in rare cases.
Try this in BE:

function loadTS($pageUid) {
    $sysPageObj = t3lib_div::makeInstance('t3lib_pageSelect');
    $rootLine = $sysPageObj->getRootLine($pageUid);
    $TSObj = t3lib_div::makeInstance('t3lib_tsparser_ext');
    $TSObj->tt_track = 0;
    $TSObj->init();
    $TSObj->runThroughTemplates($rootLine);
    $TSObj->generateConfig();
    return $TSObj->setup;
}



-- 
grtz
Krystian Szymukowicz




More information about the TYPO3-dev mailing list