2016-12-15 104 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

我明白了。謝謝,這固定了問題是的。 –