Project

General

Profile

Actions

Feature #16525

closed

"<INCLUDE_TYPOSCRIPT:" and multi level conditions

Added by Wolfgang Klinger over 18 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Category:
TypoScript
Target version:
Start date:
2006-09-04
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
nightmare
Sprint Focus:
Needs Decision

Description

<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/blub/__ts.txt">

[globalVar = GP:test = 1]
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/plob/__ts.txt">
[global]

does not work right if there are other conditions inside /plob/__ts.txt, as there are currently no multi level conditions (one condition around other conditions) possible. So you have to handle this in the file itself (currently).

I first thought about another problem here (didn't really dig into this until now), but now I think this is a lot more work, but I'll take a look at it anyway
(issue imported from #M4150)


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Feature #69789: Missing checkbox in the TypoScript Object Browser for conditions set in <INCLUDE_TYPOSCRIPT ...>Closed2015-09-14

Actions
Related to TYPO3 Core - Bug #76236: INCLUDE_TYPOSCRIPT condition PIDinRootline does not work correctyClosed2016-05-19

Actions
Related to TYPO3 Core - Bug #80150: TypoScript after include line with not matching condition is discardedClosed2017-03-06

Actions
Actions #1

Updated by Michael Stucki over 18 years ago

Please allow me to change the priority of this bug.

Actions #2

Updated by Michael Stucki over 18 years ago

Assigned to myself by mistake, sorry.

Actions #3

Updated by Martin Holtz over 18 years ago

[globalVar = GP:test = 1]
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/assets/tstest.txt">
[global]

works fine for me.
TYPO3 4.0.1

what does

[globalVar = GP:test = 1]
page.2000 = HTML
page.2000.value =
[global]

is ist possible that you made an other mistake?

Actions #4

Updated by Stefan Neufeind over 12 years ago

@core: How do we go about this? There are no multi-level conditions planned one way or the other. And if you have conditions in external files that for sure gets tricky.
Looking at the age of this ticket, should it maybe be closed wont-fix?

Actions #5

Updated by Thorsten Kahler over 12 years ago

  • Category deleted (Communication)
  • Status changed from Accepted to Needs Feedback
  • Assignee deleted (Wolfgang Klinger)
  • Target version deleted (0)
  • PHP Version deleted (4)
  • Complexity set to nightmare

+1 for wont-fix

The only way to fix that would be nested conditions which we can't realize in TS 1.0: every inclusion of a TS snippet, via DB relation or <INCLUDE_TYPOSCRIPT...>, adds an implicit [global] to the end of that snippet to make sure that all conditions are working only locally. Changing that would surely be breaking many installations.

Actions #6

Updated by Stefan Neufeind almost 12 years ago

If I understand it right then conditions inside the included file do not work? Or what is the problem? Could it be that the condition (to include a file or not) is evaluated after resolving the include (including it's code)? Could we do the includes while evalutating the conditions, thus allowing to conditionally include the file or not? After the inclusion of course the mentioned implicit [global] occurs.

Actions #7

Updated by Alexander Opitz over 11 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Actions #8

Updated by Niels Tiedt about 11 years ago

  • Status changed from Closed to New

It would be nice if you could implement a condition feature for the external TS-file include.
Maybe it is possible to fix the above problem with an additional attribute in the INCLUDE_TYPOSCRIPT-Tag.

<INCLUDE_TYPOSCRIPT:source="file:mypath/myfile.ts":condition="globalVar = TSFE:id = 1">

Actions #9

Updated by Susanne Moog over 9 years ago

  • Sprint Focus set to PRC
Actions #10

Updated by Jigal van Hemert over 9 years ago

  • Status changed from New to In Progress

It can probably be done if we add an optional property to the tag:

<INCLUDE_TYPOSCRIPT:source="file:xxx" condition="yyyy">
<INCLUDE_TYPOSCRIPT:source="dir:zzz" extension="ts" condition="yyyy">

In the core the condition matcher object is already present and must simply be passed when the includes are processed. The condition matcher object can be optional; if no condition matcher object is available in third party code the condition is simply ignored.

Actions #11

Updated by Jigal van Hemert over 9 years ago

  • Category set to TypoScript
  • Assignee set to Jigal van Hemert
  • Target version set to 7.5
Actions #12

Updated by Gerrit Code Review over 9 years ago

  • Status changed from In Progress to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42431

Actions #13

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42431

Actions #14

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42431

Actions #15

Updated by Sebastian Schmal over 9 years ago

jep i have the same problem in T3 6.4.xx

[globalVar = LIT:1 = {$ck.theme.enable}]
    <INCLUDE_TYPOSCRIPT: source="FILE: EXT:test/Configuration/TypoScript/AllConstants.ts">
[global]
Actions #16

Updated by Gerrit Code Review over 9 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42431

Actions #17

Updated by Gerrit Code Review about 9 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42431

Actions #18

Updated by Gerrit Code Review about 9 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42431

Actions #19

Updated by Gerrit Code Review about 9 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42431

Actions #20

Updated by Gerrit Code Review about 9 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42431

Actions #21

Updated by Gerrit Code Review about 9 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42431

Actions #22

Updated by Jigal van Hemert about 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #23

Updated by Sebastian Schmal about 9 years ago

dissolved in T3 6.2 ?

Actions #24

Updated by Jigal van Hemert about 9 years ago

Sebastian Schmal wrote:

dissolved in T3 6.2 ?

No solution for 6.2.x. It's a feature so it will only go into new releases (7.5 in this case).

Actions #25

Updated by Sebastian Schmal about 9 years ago

mhhh, we need this in 6.2 :(
Is there another solution for 6.2 ?

Actions #26

Updated by Niels Tiedt about 9 years ago

You can set the conditions in the external ts-file.

Actions #27

Updated by Sebastian Schmal about 9 years ago

Niels Tiedt wrote:

You can set the conditions in the external ts-file.

jep this works.

Actions #28

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions #29

Updated by Benni Mack over 4 years ago

  • Sprint Focus changed from PRC to Needs Decision
Actions

Also available in: Atom PDF