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.

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

eZ debug

Timing: Jan 18 2025 22:27:41
Script start
Timing: Jan 18 2025 22:27:41
Module start 'layout'
Timing: Jan 18 2025 22:27:41
Module start 'content'
Timing: Jan 18 2025 22:27:42
Module end 'content'
Timing: Jan 18 2025 22:27:42
Script end

Main resources:

Total runtime1.5470 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0107 589.0703152.6250
Module start 'layout' 0.01070.0034 741.695339.4453
Module start 'content' 0.01411.5315 781.1406541.7500
Module end 'content' 1.54560.0014 1,322.890612.1563
Script end 1.5470  1,335.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.2391160.0002
Check MTime0.00130.0840160.0001
Mysql Total
Database connection0.00430.276610.0043
Mysqli_queries1.482595.8273570.0260
Looping result0.00060.0377550.0000
Template Total1.506897.420.7534
Template load0.00210.135220.0010
Template processing1.504797.259820.7523
Template load and register function0.00020.016210.0002
states
state_id_array0.00110.073110.0011
state_identifier_array0.00250.160520.0012
Override
Cache load0.00180.1185510.0000
Sytem overhead
Fetch class attribute can translate value0.00060.039820.0003
Fetch class attribute name0.00210.136840.0005
XML
Image XML parsing0.00070.047720.0004
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00080.0513170.0000
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs