[Typo3-dev] How to access TypoScript from BE
Thorsten Kahler
thorsten.kahler at dkd.de
Mon Apr 4 15:40:35 CEST 2005
Hi Elmar,
you just need a few lines of PHP to access FE-TypoScript. I recently used
something like this from within a BE module:
require_once (PATH_t3lib.'class.t3lib_page.php');
require_once (PATH_t3lib.'class.t3lib_tstemplate.php');
class myBEmoduleextends t3lib_SCbase {
var $sysPage = ''; // page selector obj
var $tmpl = ''; // TS template obj
// ...
function init() {
// ...
// initialize the page selector
$this->sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
$this->sys_page->init(true);
// initialize the TS template
$this->tmpl = t3lib_div::makeInstance('t3lib_TStemplate');
$this->tmpl->init();
$rootline = $this->sys_page->getRootLine( $this->id );
$this->tmpl->start($rootline);
// ...
}
// ...
}
There's also a method t3lib_BEfunc::BEgetRootLine(), but that wouldn't
return the rootline as it's used in the FE.
Please report if you're facing problems with this approach, so I could
advance it within my ext too.
Regards
Thorsten
Am Mon, 04 Apr 2005 13:15:51 +0200 schrieb Elmar Hinz
<elma.hinz at vcd-berlin.de>:
> Hello,
>
> to automatically generate a selection input for a flexform in the
> Backend, I need to access the TypoScript-array of the FE.
>
> I find functions to access TS and module-TypoScript, but no Function to
> access the FE-TypoScript. Any hints?
>
> Thank you
More information about the TYPO3-dev
mailing list