Bug #43706
closedConstants in a page-TSconfig only accepted with an ext. template!?
0%
Description
It is possible to set a constant in page-properties => resources => TSconfig like this:
TSFE.constants.myConstant1 = 12345
E.g. you put this into a page with the ID 123 and you use a condition in the main template setup like this:
[PIDupinRootline = {$myConstant1}]
statements..
[END]¶
This condition does not work because you did not create an ext. template for page ID 123 - although constants are existing from the inherited root template.
Files
Updated by Chris topher over 11 years ago
- Status changed from New to Needs Feedback
I think what you write is correct. TSconfig says that
If you want the Page TSconfig constant defaults to affect only a certain branch of the page tree (since you use PIDupinRootline to set some statements only for those pages, that seems to be what you want), make sure to create a template record (a blank one will do) on the page that carries the Page TSconfig information.
I don't see a bug in what you write; although I must admit that I also do not really understand, what a real usecase for this feature would actually be.
Updated by Kurt Kunig over 11 years ago
"I also do not really understand, what a real usecase for this feature would actually be."
e.g. an editor has no BE web-menu "Template" but he has the field page-TSConfig!
Normally this should be reaseon enough!?
I use it for image-description for images out of page resources that will be shown as a slider with jQuery.
An editor uploads two images e.g. into the page resources and writes into the page TSConfig:
TSFE.constants.myConstant1 = This is image 1
TSFE.constants.myConstant2 = This is image 2
Updated by Alexander Opitz about 11 years ago
- Is Regression set to No
Hi,
As this issue is a bit old, does this issue still exists in newer TYPO3 CMS Versions (6.1.5)?
Updated by Kurt Kunig about 11 years ago
TSFE.constants.xxx still do NOT work without an Ext.-Template. :-(
TYPO3 version 6.1.5
Updated by Alexander Opitz about 11 years ago
- Category set to TypoScript
- Status changed from Needs Feedback to New
So I understand this more as feature request to change the behavior.
Updated by Mathias Schreiber almost 10 years ago
- Target version set to 7.2 (Frontend)
Updated by Mathias Schreiber almost 10 years ago
Note: We need to take a look on the performance implication if we walk through the rootline and have the TS parser run through potentially a LOT of TSConfig.
Updated by Benni Mack over 9 years ago
- Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Target version deleted (
7.5)
As TSconfig and TypoScript should be admin only, I don't even see a use case for this, really.
Updated by Kurt Kunig about 9 years ago
I cannot accept the remark of Benjamin.
A page TSConfig is still available for editors, not only for admins!
The attached image shows that field. The user locked in as an editor.
Updated by Riccardo De Contardi about 6 years ago
This issue seems still present in 9.5.2-dev (latest master)
Minimal test setup:
1) In your homepage with the main TS Template write:
page.11=TEXT page.11.value = {$myConstant} page.11.wrap=<h1>|</h1>
2) Create a page and write in TS Config field (resources tab):
TSFE.constants.myConstant = HELLO WORLD!
3) Save and preview
Result:¶
the constant is not replace and in frontend you will see:
<h1>{$myConstant}</h1>
4) Now add an EXT TypoScript Template in the same page; save and preview
Result:¶
the constant is now used:
<h1>HELLO WORLD!</h1>
Updated by Riccardo De Contardi over 5 years ago
This issue seems is present on 10.0.0-dev (latest master) - tested with the same procedure on my comment 12
Updated by Benni Mack over 4 years ago
- Status changed from New to Closed
Hey all,
this feature was removed in TYPO3 v10 and re-introduced with Site Settings in TYPO3 v10 LTS. https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/10.4/Feature-91080-SiteSettingsAsTsConstantsAndInTsConfig.html