Forums / Developer / [SOLVED] Match[class_group]

[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!