Template override is looking into extension directory?

Template override is looking into extension directory?

Wednesday 23 February 2011 10:58:24 pm - 4 replies

Modified on Wednesday 23 February 2011 10:59:17 pm by Chirag Patel

Author Message

Karol Radziuk

Thursday 24 February 2011 2:11:20 am

Hi,

eZ is looking in extension folder at first.

Order depends on [DesignSettings] in site.ini, then [ExtensionSettings].

After all eZ try to load tpl file from design/standard/... (standard is default location)

Check here: http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Templates/The-template-override-system

{$me|attribute(show,1)}

André R.

Thursday 24 February 2011 2:11:28 am

The reason is the order design as used.

From a birds view eZ Publish reads the designs settings in the following order: SiteDesign, AdditionalSiteDesignList[] & StandardDesign.

For each design (and this answers your question) it finds templates in the following order: extensions (reverse order I think) and then design folder.

This template name lookup stuff is cached, hence why you need to clear template override cache when you add/remove templates.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Chirag Patel

Thursday 24 February 2011 8:44:15 am

Hi Karol and Andre,

Thanks for the response.

I thought new custom templates I want, should be put into the directory /design/ezwebin/override/templates/.

Am I doing that wrong? What's the right practice?
If it's right, How can I make the template override work from /design/ezwebin/override/templates/ ?

Thanks,
Chirag

Karol Radziuk

Friday 25 February 2011 12:31:24 am

Hi

Good practice is to create new files in your own extension. Then you can override file with using the same name like in ezwebin (it is extension too).

If design folder from your extension is named identically, then its declaration in settings/override/site.ini.append.php ([ExtensionSettings] ActiveExtensions[]=...) must be first (not sure for 100%).

Else if design folder from your extension is named differently, then then its design declaration in settings/siteaccess/<custom_siteaccess>/site.ini.append.php ([DesignSettings] SiteDesign=firstdesign AdditionalSiteDesignList[]=seconddesign) must be first

{$me|attribute(show,1)}

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.