René M.
René M.

Reputation: 394

TYPO3: Site Configuration Data inside TSconfig Condition

The divider content element is disabled for all pages via TCEFORM.tt_content.CType.removeItems := addToList([…], div) in PageTSconfig. This works just fine.

Now I want that the divider is only available for a certain subset of pages. I defined the uppermost page in my site configuration which leads to the following Typoscript:

[site("configuration")["settings"]["pages"]["simpleLanguage"] and site("configuration")["settings"]["pages"]["simpleLanguage"] in tree.rootLineIds]
    TCEFORM.tt_content.CType.removeItems := removeFromList(div)
[END]

Now when I want to insert an divider on that given pages, I can choose it from the NewContentElement Wizard, but when the form of the content element gets rendered the divider is missing in the CType select.

Divider is shown

Divider is shown in NewContentElement Wizard

Divider is missing here

But not in the content element form.

I found out that when setting the pageuid directly, the condition is evaluated fine. So my conclusion ist that I cannot get site information inside TSconfig.

So how can I get the information from the site config inside TSconfig?

Upvotes: 0

Views: 628

Answers (2)

Jonas Eberle
Jonas Eberle

Reputation: 2921

Conditions in PageTS have been fixed for TYPO3 v10 with https://forge.typo3.org/issues/89718.

The patch has not been backported to v9 due to its complexity.

Upvotes: 1

Jonas Eberle
Jonas Eberle

Reputation: 2921

The new content element wizard uses another configuration:

https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/PageTsconfig/Mod.html#newcontentelement-wizarditems

# PageTS
# CType "div" is in group "special"
mod.wizards.newContentElement.wizardItems.special.show := removeFromList(div)

Upvotes: 0

Related Questions