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.

eZ debug

Timing: Jan 31 2025 06:27:35
Script start
Timing: Jan 31 2025 06:27:35
Module start 'content'
Timing: Jan 31 2025 06:27:35
Module end 'content'
Timing: Jan 31 2025 06:27:35
Script end

Main resources:

Total runtime0.0186 sec
Peak memory usage4,096.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 587.9531180.8281
Module start 'content' 0.00820.0065 768.781393.8828
Module end 'content' 0.01470.0038 862.664170.7031
Script end 0.0185  933.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002412.9246120.0002
Check MTime0.00105.5900120.0001
Mysql Total
Database connection0.00115.688710.0011
Mysqli_queries0.002915.644640.0007
Looping result0.00000.124320.0000
Template Total0.003418.110.0034
Template load0.00094.870910.0009
Template processing0.002513.236110.0025
Override
Cache load0.00063.107110.0006
General
dbfile0.00052.4432100.0000
String conversion0.00000.097430.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs