2016-12-15 34 views
2

我正在使用TYPO3 7.6.14版本,并且为客户端创建了一个扩展,它有四个控制器,四个插件以及相当大的整体。无论如何,现在我需要为动态或用户选择的“页面ID”添加选项(设置变量),然后用于从一个插件重定向到另一个插件。有可能是我的问题更好的解决方案,但我想这样做:

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 = 
    } 
} 

现在的问题是,即使我100%肯定的TypoScript正确纳入其中扩展加载页面,变量$this->settings['productsPage']和FLUID {settings.productsPage}不起作用。我清除了整个缓存,甚至试图删除整个typo3temp文件夹,它仍然无法正常工作。我也试过调试$this对象,它说settings => NULL

Image from objects browser

哦productsPage被输入默认的根模板下的“设置”,并浏览Typo脚本对象时(行政)我可以看到设置就好了设置。所以我不认为我有无效的TypoScript。

回答

5

如果您有四个插件,您必须为每个插件设置Typoscript设置。如果您的Typoscript包含正确的内容,则“设置”仅适用于插件“购物篮”。

另一件事:您的Typoscript中的评论看起来像那些设置是Typoscript常量而不是Typoscript设置。在设置中,您必须将这些常量传递给插件配置。例如:

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

您还必须将模板等的其他常量传递给设置。

+0

感谢您的回复。我知道我必须为每个插件添加设置,我已经粘贴了四分之一的示例。抱歉不清除。我只关心在控制器和流体中获得$ this->设置。我也更新了来自对象浏览器的图像问题。 –

+2

常量在您的输入框中不能自动提供。这就是保罗所描述的。 –

+0

我明白了。谢谢,这固定了问题是的。 –