Evil Penguin Evil Penguin - 1 year ago 102
PHP Question

Typo3 add a new option or change existing options in backend for Page Frontend Layout drop down not working

i am clearly missing something, but i can't figure out what. I am developing site on Typo3 CMS v7.6.10. I included my extension configuration in TS template.

In \Configuration\TCA\Overrides\pages.php:

defined('TYPO3_MODE') or die();

// Add pageTSconfig
'/**/', // my extension
'My special config'

In \Configuration\PageTS\pages.ts: (from question here)

TCEFORM.pages {
layout.altLabels.0 = Normal
layout.altLabels.1 = Startpage
layout.altLabels.2 = Landing page

After clearing all cache, reinstalling extension nothing had changed in Edit page - Appearance - Frontend Layout drop down. Am i wrong and this configuration is for something else? This is just an example of me using
, my attempts to do something with other elements not working too. Do i need to include registered config file? If so, nothing appears in my typoscript template include options.

Answer Source

I am not sure if you did this but


"only" registers a PageTSConfig file for the selection in the page property. To include it you have to go to the properties of a page in the resources tab and select your file there (see screenshot). It is then active for this page and all subpages.

Select PageTSConfig in page properties

As an alternative you could use ExtensionManagementUtility::addPageTSConfig() instead. If you pass the <INCLUDE_TYPOSCRIPT string to that function your PageTSConfig will be loaded on every page.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download