"<INCLUDE_TYPOSCRIPT:" and multi level conditions
<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)
Updated by Martin Holtz about 17 years ago
[globalVar = GP:test = 1]
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/assets/tstest.txt">
works fine for me.
[globalVar = GP:test = 1]
page.2000 = HTML
is ist possible that you made an other mistake?
Updated by Stefan Neufeind over 11 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?
Updated by Thorsten Kahler over 11 years ago
- Category deleted (
- Status changed from Accepted to Needs Feedback
- Assignee deleted (
- Target version deleted (
- PHP Version deleted (
- 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.
Updated by Stefan Neufeind almost 11 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.
Updated by Niels Tiedt about 10 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">
Updated by Jigal van Hemert over 8 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.