2016-02-26 130 views

回答

1

design部分design:article/full.tpl已經應該做你想做的。它將搜索article/full.tpl模板,從設計文件夾extension/myextension/design中的templates文件夾開始。

的eZ發佈將使用以下規則來找到好的模板:

第一:確定的,其設計是用於siteaccess。見[DesignSettings]塊在site.ini文件小號

[DesignSettings] 
SiteDesign=a_design_specific_or_not_to_your_siteaccess 
AdditionalSiteDesignList[]=another_generic_design 
AdditionalSiteDesignList[]=standard 
AdditionalSiteDesignList[]=base 

然後:確定的哪些擴展提供設計。查看每個擴展的design.ini文件[ExtensionSettings]塊(extension/ezflow/settings/design.ini.append.php的爲例):

[ExtensionSettings] 
DesignExtensions[]=ezflow 

最後,eZ Publish的外觀爲模板。 SiteDesign設計將首先嚐試,然後全部從上到下設計AdditionalSiteDesignList。找到模板後,查找停止,並且緩存此信息(即使您的TemplaceCache/TemplateCompile/...已禁用)。記住緩存部分,每次添加一個新模板,意圖覆蓋另一個模板時,都需要清除緩存。

因此,如果我們只有2個擴展提供設計,說ezflowmysite,eZ Publish的將嘗試以下路徑:

extension/mysite/design/a_design_specific_or_not_to_your_siteaccess/templates/full/article.tpl 
extension/mysite/design/another_generic_design/templates/full/article.tpl 
extension/mysite/design/standard/templates/full/article.tpl 
extension/mysite/design/base/templates/full/article.tpl 

extension/ezflow/design/a_design_specific_or_not_to_your_siteaccess/templates/full/article.tpl 
extension/ezflow/design/another_generic_design/templates/full/article.tpl 
extension/ezflow/design/standard/templates/full/article.tpl 
extension/ezflow/design/base/templates/full/article.tpl 

design/a_design_specific_or_not_to_your_siteaccess/templates/full/article.tpl 
design/another_generic_design/templates/full/article.tpl 
design/standard/templates/full/article.tpl 
design/base/templates/full/article.tpl 

注意,我所做的mysite延伸具有更高的優先級高於設定ezflow。見settings/override/site.ini.append.php

[ExtensionSettings] 
ActiveExtensions[] 
ActiveExtensions[]=mysite 
.... 
ActiveExtensions[]=ezflow 
.... 

這是system模板。當涉及到內容模板(由attribute_view_guinode_view_gui函數使用的模板)時,該過程稍有不同,請參見https://doc.ez.no/eZ-Publish/Technical-manual/4.x/Templates/The-template-override-system

相關問題