[SOLVED] Match[class_group]

Author Message

Salvatore Guarino

Monday 12 September 2005 6:14:07 am

I have tried to override a template using as 'match' parameter [class_group], like this example:

[table]
Source=node/view/full.tpl
MatchFile=full/table.tpl
Subdir=templates
Match[class_group]=tables

It doesn't work. I'm using eZ publish 3.6.
I have to do something to activate this function?

Thank you,

Bye

Kristof Coomans

Monday 12 September 2005 6:35:38 am

In content.ini, you'll need to set EnableClassGroupOverride to true:

[ContentOverrideSettings]
# Set this to true if you would like to do an override
# based on the class group of the content
EnableClassGroupOverride=false

You also need to use class group ID's instead of names. The following matches the Content class group:

Match[class_group]=1

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Salvatore Guarino

Monday 12 September 2005 7:04:14 am

Dear Kristof, thank you very much.
I have tried, but maybe I made an error in a step and it doesn't work. I made this:
1. I edited the file settings/siteacces/<i>mysiteaccess</i>/content.ini.append.php
adding this:

[ContentOverrideSettings]
EnableClassGroupOverride=true

2. I created a new class named "groups_table" and I have put this class in "tables" class group (ID 5).

3. I have added this code in settings/siteacces/<i>mysiteaccess</i>/override.ini.append.php

[table]
Source=node/view/full.tpl
MatchFile=full/table.tpl
Subdir=templates
Match[class_group]=5

4. I have deleted all the cache, but when I view a node containing an object create with the "groups_table" class the override system doesn't work and eZ publish use the standard template "design/standard/templates/node/view/full.tpl" instead the "full/table.tpl".

Maybe I committed some errors in this procedure?

Salvatore Guarino

Monday 12 September 2005 7:48:40 am

I've solved!
The problem was that I have created 2 override with the same name! Thx!

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 20 2025 14:26:48
Script start
Timing: Jan 20 2025 14:26:48
Module start 'layout'
Timing: Jan 20 2025 14:26:48
Module start 'content'
Timing: Jan 20 2025 14:26:49
Module end 'content'
Timing: Jan 20 2025 14:26:49
Script end

Main resources:

Total runtime1.1682 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.1563152.6250
Module start 'layout' 0.00460.0025 741.781339.4453
Module start 'content' 0.00711.1595 781.2266563.2578
Module end 'content' 1.16670.0015 1,344.484412.1641
Script end 1.1681  1,356.6484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2665160.0002
Check MTime0.00120.1040160.0001
Mysql Total
Database connection0.00090.073410.0009
Mysqli_queries1.115995.5261600.0186
Looping result0.00050.0436580.0000
Template Total1.142697.820.5713
Template load0.00210.182220.0011
Template processing1.140597.628420.5702
Template load and register function0.00010.009210.0001
states
state_id_array0.00080.064410.0008
state_identifier_array0.00100.085020.0005
Override
Cache load0.00180.1559320.0001
Sytem overhead
Fetch class attribute can translate value0.00050.044820.0003
Fetch class attribute name0.00090.077060.0001
XML
Image XML parsing0.00090.076520.0004
class_abstraction
Instantiating content class attribute0.00000.001680.0000
General
dbfile0.00090.0766230.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/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/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs