Forums / Setup & design / Separate pagelayout for objects in: section==x where contentclass id==x

Separate pagelayout for objects in: section==x where contentclass id==x

Author Message

Laura Gasslein

Thursday 29 July 2010 10:45:10 am

Hi, I'm sorry if this has been solved before, but I searched and couldn't find anything that exactly answers my question. This is for an EZ 4.0.1 site.

I have an existing section in EZ that corresponds to a subtree in the content tree. Its section id is 7. Under that section's parent folder, (among others) I have content objects of contentclass="xxx". I would like to display a new, custom pagelayout only for these objects of contentclass="xxx" , which exist within section 7.

I would love to do this without creating a new design or a new extension. I only need a new pagelayout, not anything else (in concept, what I want is similar to the print layout.)

Any help is appreciated!

Thiago Campos Viana

Thursday 29 July 2010 12:25:03 pm

There's some documentation about it:

http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_override_conditions

http://ez.no/doc/ez_publish/technical_manual/4_x/templates/the_template_override_system

"The pagelayout may be overridden using the same keys that are available for the view which was used within the request. For example, if the "view" view of the "content" module was accessed, then the override conditions of that view will be matched. This makes it possible to create a pagelayout override that will be triggered when, for example, nodes referencing objects that belong to a certain section are requested."

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br

Laura Gasslein

Thursday 29 July 2010 1:54:10 pm

Thanks for the quick reply!

I have tried this with override rules, but I can't seem to get EZ to pick up on the override rule and actually use it.

Here is an example of what I have in override.ini.append.php

[pagelayout_xxx]
Source=pagelayout.tpl
MatchFile=pagelayout_xxx.tpl
Subdir=templates
Match[class_identifier]=xxx
Match[section]=7

This is at the top of the ini file. But, EZ doesn't use this rule. EZ continues to use the same pagelayout that is used as the default for all other pages in this siteaccess.

Thiago Campos Viana

Thursday 29 July 2010 2:55:01 pm

It could be an extension priority problem.

Change settings/override/site.ini.append

[ExtensionSettings]
ActiveExtensions[]=yourdesignextension
ActiveExtensions[]=otherextension1
ActiveExtensions[]=otherextension2

.....

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br