Typoscript use constant in include_typoscript
Asked Answered
C

1

6

Can we use constant variable in include_typoscript

In my constants.txt file

filepaths{
    # cat=FLUIDPAGES/settings; type=text; label=Pfad zu den Templates
    defaultTemplateRootPath = typo3conf/ext/defaulttemplate/
}

In my setup.txt file

Include Page Template
<INCLUDE_TYPOSCRIPT: source="FILE: {$filepaths.defaultTemplateRootPath}fluid.txt">

I just need to use {$filepaths.defaultTemplateRootPath} in my setup file for include typoscript file, If yes it's very helpful for me and I could add multiple themes/templates in multi - Domain site.

Coretta answered 30/1, 2014 at 5:58 Comment(2)
I have the same problem, and I believe in TYPO3 6.2, the include directive will allow relative paths, which would ease the situation.Evolve
Yeah, Jost! include all my ts using DIR instead of FILE individual. But be ensure all file extension with .ts. <INCLUDE_TYPOSCRIPT: source="DIR: EXT:defaulttemplate/Configuration/TypoScript" extensions="ts">Coretta
V
3

According to https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/TypoScriptSyntax/Syntax/Includes.html you can't use constants in the INCLUDE_TYPOSCRIPT part:

It is processed BEFORE any parsing of TypoScript

But you could use the following method in your localconf.php

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript('myKey', 'setup', '<INCLUDE_TYPOSCRIPT: source="FILE:' . $filePath . 'fluid.txt">');
Vasoconstrictor answered 30/1, 2014 at 6:42 Comment(1)
the link is dead ^^Miniaturist

© 2022 - 2024 — McMap. All rights reserved.