Bug #88478

INCLUDE_TYPOSCRIPT condition parameter not evaluating symfony expressions

Added by Christian Eßl 4 months ago. Updated 21 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2019-06-03
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

There is a "condition"-Parameter for the include-instruction for importing TS files only if a TS condition is matched. These appear to not allow for symfony expressions at the moment.

Example:

This is working (old syntax):

<INCLUDE_TYPOSCRIPT: source="FILE:EXT:theme/Configuration/TypoScript/Constants/Development.typoscript" condition="[applicationContext = Development]">

This is not working (symfony expression):

<INCLUDE_TYPOSCRIPT: source="FILE:EXT:theme/Configuration/TypoScript/Constants/Development.typoscript" condition="[applicationContext == "Development"]">

History

#1 Updated by Jan Stockfisch 4 months ago

Christian Eßl wrote:

This is not working (symfony expression):

<INCLUDE_TYPOSCRIPT: source="FILE:EXT:theme/Configuration/TypoScript/Constants/Development.typoscript" condition="[applicationContext == "Development"]">

Hi Christian,

Try using single quotes inside the double quotes. While using quotes, your code should work as expected. Otherwise escaping will work too.

<INCLUDE_TYPOSCRIPT: source="FILE:EXT:theme/Configuration/TypoScript/Constants/Development.typoscript" condition="[applicationContext == 'Development']">

OR

<INCLUDE_TYPOSCRIPT: source="FILE:EXT:theme/Configuration/TypoScript/Constants/Development.typoscript" condition="[applicationContext == \"Development\"]">

Using double quotes inside double quotes will result in an expression like this:

[applicationContext == 

#2 Updated by Jan Stockfisch 4 months ago

  • Status changed from New to Needs Feedback

#3 Updated by Riccardo De Contardi 22 days ago

Hi, the documentation has been updated: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/TypoScriptSyntax/Syntax/Includes.html

Do you think this is sufficient to consider this issue closed or is there something that should be investigated further?

Thank you for your answer and sorry for the late reply.

#4 Updated by Christian Eßl 21 days ago

I think this can be closed!

#5 Updated by Riccardo De Contardi 21 days ago

  • Status changed from Needs Feedback to Closed

Closed in agreement with the reporter.

Thanks for the quick reply.

Also available in: Atom PDF