[TYPO3-dev] parsing TSconfig in BE-module?

Ernesto Baschny eb at cron.eu
Mon Mar 3 16:47:52 CET 2014


Hi,

"parsing TypoScript" is just that: Transforming our TS-syntax into a
(merged) PHP array.

What is done with the PHP array depends highly on the context. Some
places in the core might use it simply as "configuration arrays" (which
is the most common use in the backend and the Page and UserTS). The
frontend content rendering (which you are referring to) uses the parsed
TS from "sys_templates" to evaluate and process the contained content
objects. Extensions might use the TS-array for other purposes.

If you need to really process content objects ("COA", "TEXT", etc) just
like in the frontend, but in the backend, you will most probably need to
simulate a "TSFE" object, create a ContentObject ("cObject") and pass
the configuration array to it.

This is not something the TypoScript in the Backend is supposed to do,
so expect things to be slow or you needing to setup so many
preconditions that it turns out to be unmaintainable.

Maybe you could share your final goal what you want to achieve with this
to get some more input or ideas on how to do reach that.

Cheers,
Ernesto

bernd wilke schrieb am 03.03.2014 12:19:
> I want to configure my BE-module from Page-TSconfig.
> 
> But I can not find a way to parse the TSconfig.
> 
> 
> all I find is a return of the origin Typoscript in a multidimensional
> array:
> \TYPO3\CMS\Backend\Utility\BackendUtility:
> :getModTSconfig($this->id, 'mod.' . $this->MCONF['name']);
> or
> \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($this->id);
> 
> 
> I thought of using the possibilities used from FE-Typoscript. something
> like:
> 
> mod.web_txmyext1M1 {
>     dummy = COA
>     dummy {
>         10 = TEXT
>         10.value = hello
>        
>         20 = TEXT
>         20.value = world
>         20.noTrimWrap = | |!|
>     }
> }
> 
> should result in
> {
> 'dummy' => 'hello world!'
> }
> instead of
> {
> 'dummy' =>    'COA',
> 'dummy.' => {    
>     '10' =>    'TEXT'
>     '10.' => {    
>         'value' =>    'hello'
>     }
>     '20' =>    'TEXT'
>     '20.' => {    
>         'value' =>    'world',
>         'noTrimWrap' =>    '| |!|'
>     }
> }
> 
> the solution should respect the rootline and aggregate TSconfig.
> 
> which functions am I missing?
> 
> T3 6.1
> 
> bernd




More information about the TYPO3-dev mailing list