[TYPO3-dev] Reuse constant in constants.txt

Helmut Hummel helmut.hummel at typo3.org
Mon Dec 14 14:44:04 CET 2015


Bernd Wilke wrote:
> Am 14.12.2015 um 09:58 schrieb Florian Rival:
>> Hi,
>>
>> Sure you can, the aim of the constants are there reusability.
>>
>> With TS, you can define a constant and redefine it later in another part
>> of the page tree if needed.
>>
>> But maybe you want to re-use a constant for another constant, that's not
>> possible, you can only use constants in setup TS.
>
> that is not correct.
>
> we always use constants like this:
>
> path.absrefprefix = /
> path.fileadmin = {$path.absrefprefix}fileadmin

Bernd is right here.

It works up to a nesting level of 10

Consider the following constants:

const1 = Foo
const2 = {$const1}
const3 = {$const2}
const4 = {$const3}
const5 = {$const4}
const6 = {$const5}
const7 = {$const6}
const8 = {$const7}
const9 = {$const8}
const10 = {$const9}
const11 = {$const10}


Then this setup:

page = PAGE
page.10 = TEXT
page.10.value = {$const10}
page.11 = TEXT
page.11.value = {$const11}

Will output:

Foo{$const1}


So Quan, your example should just work.

Kind regards,
Helmut

-- 
Helmut Hummel
Release Manager TYPO3 6.0
TYPO3 CMS Active Contributor, TYPO3 Security Team Member

TYPO3 .... inspiring people to share!
Get involved: typo3.org



More information about the TYPO3-dev mailing list