Bug #17379
closedMultiline constants
0%
Description
Multiline values with ( ) signs work in setup.txt, but don't work in constants.txt.
Reference:
http://typo3.org/documentation/document-library/core-documentation/doc_core_ts/4.1.0/view/1/2/
(issue imported from #M5783)
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0)
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Alexander Opitz almost 11 years ago
- Status changed from Needs Feedback to Closed
No feedback for over 90 days.
Updated by Bas van Beek over 8 years ago
This issue is still the case in TYPO3 6.2.15. Would be really nice if constants also supports multiline.
Now I'm forced to use setup field, but then I lose the inheritance that works with constants.
Updated by Tymoteusz Motylewski almost 8 years ago
- Status changed from Closed to New
- TYPO3 Version changed from 4.1 to 6.2
- Is Regression set to No
also exists in current v8, I'm reopening the issue
Updated by Tymoteusz Motylewski almost 8 years ago
How to test:
Constants
lib.multiline ( line 1 line2 line3 )
setup
page.9 = TEXT page.9.value = {$lib.multiline}
This will output "line 1" but should all lines.
Updated by Hannes Lau almost 7 years ago
- TYPO3 Version changed from 6.2 to 8
This issue is still current in TYPO3 8.7
Updated by Josef Glatz over 6 years ago
- Priority changed from Should have to Must have
- TYPO3 Version changed from 8 to 9
This "issue" is still current in TYPO3 9.2.0-dev.
Mathias mentioned in #59714-1 that multiline TypoScript Constants are not intended. But actually there's- no documentation about it (https://docs.typo3.org/typo3cms/TyposcriptSyntaxReference/8.7/singlehtml/#constants)
- and no limitation in e.g. TSConfig Editor for Constants in TYPO3 backend
A clear statement would be good. We can take this into the documentation or even fix multiline constants? or maybe some warning/log when (
instead of =
is used in TypoScript constants context.
Updated by J W over 6 years ago
I wanted to share my research:
Multiline constants actually do work (tested on latest master).
The line break and tabs are preserved.
However the constants value is replaced in the typoscript setup the linebreak will also be added causing it to be invalid typoscript.
The actual replacement happens inside the\TYPO3\CMS\Core\TypoScript\TemplateService::substituteConstants.
A constant
temp.multiTest (
Hello
World
)
with typoscript
page.8 = TEXT
page.8.value = {$temp.multiTest}
results in
page.8 = TEXT
page.8.value = Hello
World
So to fix this we need to change the \TYPO3\CMS\Core\TypoScript\TemplateService::substituteConstantsCallBack method to wrap the constants value in a multiline if it is multiline.
Updated by J W over 6 years ago
Updated by Anja Leichsenring over 6 years ago
- Status changed from New to Closed
- Priority changed from Must have to Won't have this time
no multiline constants, and documentation updated accordingly.