Forums / Setup & design / overriding the basket.tpl

overriding the basket.tpl

Author Message

Pascal Specht

Wednesday 24 October 2007 8:17:59 am

Hi,

This drives me crazy, I thought I understood the template mechanism:

I want to change the template of shop/basket.tpl.

According to the debug output, this is the template that is loaded by default:

eZTemplate: Loading template "shop/basket.tpl" with resource "design"
extension/ezwebin/design/ezwebin/templates/shop/basket.tpl, utf-8

using www.mysite.com/ezwebin_site_admin/visual/templateview/shop/basket.tpl, I say that I want to use my siteaccess (ezwebin_site) and I click on New Override. I call the override my_basket.tpl and ask to make a copy of the original template.
after that, I clear all caches, and refresh a page with the shop. Nothing changed.

The settings/siteaccess/ezwebin_site/override.ini.append.php contains the following generated code:
[bg_basket]
Source=shop/basket.tpl
MatchFile=bg_basket.tpl
Subdir=templates
and the new template is correctly created here: /design/ezwebin/override/templates/bg_basket.tpl

but it's not picked up.

Any ideas why?

Thanks in advance,
</pascal>

 

André R.

Wednesday 24 October 2007 11:21:16 am

my_basket.tpl or bg_basket.tpl ??

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

Pascal Specht

Thursday 25 October 2007 1:03:33 am

Hello André,

bg_basket.tpl ... I changed the text to my_basket to make it more readable... But it is bg_basket in this case, as the .ini file shows.

</Pascal>

Pascal Specht

Thursday 25 October 2007 8:42:20 am

Could it be that this mechanism doesn't work with extensions like ezwebin?

I've tried again and it doesn't work. Also, I tried to create a very simple content class Abc in the admin interface, and define the node/view/full.tpl for this class, same punishment: it didn't work! Is there a way to see "more" in the template debug output, like what templates it tried before finding the one?

but back to shop/bg_basket.tpl:

My feeling is that even after doing the override through the admin interface, the settings in the extension have stronger precedence, and therefore the shop/basket.tpl would be taken from there...
Would it make sense to move the override.ini into the extension/ezwebin/settings folder?..

</Pascal>

Pascal Specht

Monday 29 October 2007 9:22:10 am

I'm giving up doing it the correct way. I'm going to do what most people here probably do as well: hacking the original code...