Forums / Developer / Using 1 template for more than one section/node etc?

Using 1 template for more than one section/node etc?

Author Message

Clemens T

Wednesday 11 May 2005 12:52:30 am

Heya all,
I was wondering if it is possible for me to specify more than one section/node/class for a template. It would be redundant to copy the templates I'd say. Please let me know if this is possible, so if I edit this one template, both pages will change.
Greets,
Clemens
ps: I'm not afraid of the ini files, so if it's only possible through there I'd love to hear it;).

edit: obviously I'm talking about an override here.

Hans Melis

Wednesday 11 May 2005 6:22:48 am

You can use the same override template for multiple "targets", but you can't do it with just one block in the override.ini file because you can't use an OR condition between match keys.

So you have to create one block in override.ini per match.

Example:

[news_folder]
Source=node/view/full.tpl
MatchFile=full/news_folder.tpl
Subdir=templates
Match[class_identifier]=folder
Match[node]=63

[sports_folder]
Source=node/view/full.tpl
MatchFile=full/news_folder.tpl
Subdir=templates
Match[class_identifier]=folder
Match[node]=64

Both point to the same template, but with different match keys. Also make sure the name of the block (eg [news_folder]) is different for each block.

hth

Hans
http://blog.hansmelis.be

Clemens T

Wednesday 11 May 2005 6:43:47 am

Thanks, I think this is exactly what I was looking for!! Kudos for you!
Greets,
Clemens