Forums / Developer / Article and templates

Article and templates

Author Message

Glenn MacGregor

Tuesday 02 December 2003 12:34:01 pm

Hi all,

I am having some trouble with articles and template files. I am using ezp3.2 on linux. I have overridden the article class under the full template and that works great, all articles are as I want them. Now I have created a new section "techsupport" and added a directory to that section "test". In that dir I added an article, which comes up as expected.

I want all articles in that section to look a bit different so I added a new template under 'full.tpl' with a class of 2 and section of 9 (which is techsupport). I have cleared the cache and the article still comes up with the class wide overridden template.

Is there a way to have a class wide override and then a more specific override for that class?

Thanks

Alex Jones

Tuesday 02 December 2003 12:49:58 pm

Yes, it is possible. Make sure that the more specific override (section + class) is above the less specific override (just the class) in your override.append.ini file. eZ publish will use the first override it reads that applies to the template, by placing the more specific one first you ensure that it is used for section 9, but not for other sections.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Marco Stipek

Thursday 15 January 2004 4:53:27 am

No it isn't! A specific override, e.g.:

[link_line_topnav]
Source=node/view/line.tpl
MatchFile=link_line_topnav.tpl
Subdir=templates
Match[class]=11
Match[section]=4

[generalview_link]
Source=node/view/line.tpl
MatchFile=node/view/line.tpl
Subdir=templates
Match[class]=11

Will result in an override of all Links with the more specific one. (I'm using ezpublish 3.3-1). If you change order, the more specific is completely ignored (as expected).