Forums / Setup & design / Problem with template overriding

Problem with template overriding

Author Message

Víctor Déniz

Thursday 09 October 2003 11:15:43 am

Hi folks !

I've got a problem when trying to override content/node/view/ezimage.tpl template.

I've got a class from my production, "CarpetaFoto", inside a "folder". In "CarpetaFoto" it's possible there is an "article" or there are some of them. If there is only an "article" I show it, and if there are some I show a brief description of each one. I'd like the thumbnail of each article was in the right side of the screen, and for it I override content/node/view/ezimage.tpl with a template very similar, only with an align=right in the image tag. The "article" template it's overriden too. The template structure is:

design/plain/templates/pagelayout.tpl

design/plain/templates/page_mainarea.tpl

design/plain/override/templates/carpetaservicios.tpl - CarpetaFoto class

design/plain/override/templates/articulo.tpl - Article class

design/standard//templates/content/node/view/ezimage.tpl - Image class

The last one, Image class template, its not the one I'd like. The override doesn't work. The template should be

design/plain/override/templates/imagenespecial.tpl

My override.ini.append is:

[articulo]
Source=node/view/full.tpl
MatchFile=articulo.tpl
Subdir=templates
Match[class]=2

[carpetaservicios]
Source=node/view/full.tpl
MatchFile=carpetaservicios.tpl
Subdir=templates
Match[class]=16
Match[section]=6

[imagenespecial]
Source=content/datatype/view/ezimage.tpl
MatchFile=imagenespecial.tpl
Subdir=templates
Match[class]=2
Match[section]=6

where 2 class = Article class an section=6 is the CarpetaFoto class.

I know is very difficult to understand because I only speak a little English. If you like to view the site I can publish it.

Thanks in advance.

Paul Borgermans

Thursday 09 October 2003 11:25:46 am

You have to put the [imagenespecial] before [articulo]. The override picks teh first that matches so you need to put the most specific first.

hth
-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Víctor Déniz

Friday 10 October 2003 5:37:31 am

Thanks Paul.

That its no my case, but your answer it's very useful for another problem that I've got at the moment.

This time was an concept error. Really I'm displaying CarpetaFoto, rendering with attribute_view_gui the Article members. The solution is:

imagenespecial]
Source=content/datatype/view/ezimage.tpl
MatchFile=imagenespecial.tpl
Subdir=templates
Match[class]=16
Match[section]=6

where 16 is the CarpetaFoto class.

Thanks a lot.