Search code examples
typo3typoscripttypo3-8.xtypo3-extensions

Delete Settings in setup.ts if I use it in pageSetup.ts (TYPO3)?


I have an Extension, for basic Settings.

Here I have TypoScript Files (in all three files are more settings, but for clarity I just put only one sample inside):

Configuration/TypoScript/constants.ts

plugin.tx_rmbase {
    settings {
        # cat=plugin.tx_rmbase/01_SiteSettings/a; type=string; label=Site Claim
        siteClaim = proudly presents by MonTea
    }
}

I want to use this in my Fluid-Template (not for an Action - just for the Backendlayouts). I have no Controller in this Extension.

In the Configuration/TypoScript/setup.ts I have the following:

plugin.tx_rmbase {
    settings {
        siteClaim = {$plugin.tx_rmbase.settings.siteClaim}
    }
}

In my other Extensions - that works without any additional Configurations - simply with e.g. {settings.siteClaim} in the Fluid Templates, and with e.g. $this->settings['siteClaim'] in the Controller.

I found a way to use it in my Fluidtemplate by editing my Resources/Private/TypoScript/pageSetup.ts like this:

page = PAGE
page {
    10 = FLUIDTEMPLATE
    10 {
        settings {
            # Settings for Usage in Frontend
            siteClaim = {$plugin.tx_rmbase.settings.siteClaim}
        }
    }
}

But if I doesn't need the Settings from setup.ts, because that doesn't work, I could delete that Settings-part in setup.ts ???

Is there a reason, why I shouldn't - or can I do it?

Edit

Update: Does someone knows, why the setup.ts-Part doesn't work in my BE-Layout-Template?


Solution

  • Be aware that you are working in another context. This will affect the visibility of your fluid variable. Especially you have no access to that data in PHP.

    Otherwise you can delete all typoscript you know to be unused. This also will speed up the rendering of your site as the parsing of typoscript will be simplified. (for this small part it will not be noticable, but bigger parts may be worth)