Bug #43706
closed
Constants in a page-TSconfig only accepted with an ext. template!?
Added by Kurt Kunig almost 12 years ago.
Updated over 4 years ago.
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
- 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.
"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
Hi,
As this issue is a bit old, does this issue still exists in newer TYPO3 CMS Versions (6.1.5)?
TSFE.constants.xxx still do NOT work without an Ext.-Template. :-(
TYPO3 version 6.1.5
- Category set to TypoScript
- Status changed from Needs Feedback to New
So I understand this more as feature request to change the behavior.
- Target version set to 7.2 (Frontend)
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.
- Target version changed from 7.2 (Frontend) to 7.4 (Backend)
- Target version changed from 7.4 (Backend) to 7.5
- Target version deleted (
7.5)
As TSconfig and TypoScript should be admin only, I don't even see a use case for this, really.
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.
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>
This issue seems is present on 10.0.0-dev (latest master) - tested with the same procedure on my comment 12
- Status changed from New to Closed
Also available in: Atom
PDF