3
votes

I'm using TYPO3 version 7.6.14 and I've created an extension for client which has four controllers, four plugins and its pretty big overall. Anyway now I'm required to add option (settings variable) for dynamic or user selected "page id" which is then used to redirect from one plugin to another. There might be better solution for my problem but I'm trying to do something like:

plugin.tx_extname_basket {
    view {
        # cat=plugin.tx_extname_basket/file; type=string; label=Path to template root (FE)
        templateRootPath = EXT:extname/Resources/Private/Templates/
        # cat=plugin.tx_extname_basket/file; type=string; label=Path to template partials (FE)
        partialRootPath = EXT:extname/Resources/Private/Partials/
        # cat=plugin.tx_extname_basket/file; type=string; label=Path to template layouts (FE)
        layoutRootPath = EXT:extname/Resources/Private/Layouts/
    }
    persistence {
        # cat=plugin.tx_extname_basket//a; type=string; label=Default storage PID
        #storagePid =
    }
    settings {
        #  cat=plugin.tx_extname_basket//a; type=int; label=Products Page ID
        productsPage =
    }
}

Now the problem is that even though I am 100% sure Typoscript is properly included into page where extension is loaded, the variables $this->settings['productsPage'] and in FLUID {settings.productsPage} doesn't work. I cleared whole cache and even tried removing whole typo3temp folder and it still doesn't work. I also tried debugging $this object and it says settings => NULL.

Image from objects browser

Oh the productsPage is entered in Default Root template under "SETUP" and when browsing Typoscript objects (in administration) I can see the setting set just fine. So I don't think I have invalid TypoScript.

1

1 Answers

6
votes

If you have four plugins you have to set this Typoscript settings for each plugin. If your Typoscript above is included correctly, "settings" will only be accessible for the plugin "basket".

Another thing: The comments in your Typoscript seems like those settings are Typoscript constants and not Typoscript setup. In the setup you have to pass those constants to the plugin configuration too. Example:

plugin.tx_extname_basket {
    settings {
        productsPage = {$plugin.tx_extname_basket.settings.productsPage}
    }
}

You also have to pass the other constants for templates etc. to the setup.