Forums / Setup & design / Please help me

Please help me

Author Message

Kjerand Pedersen

Thursday 24 July 2003 9:28:14 am

I previously posted this http://www.ez.no/developer/ez_publish_3/forum/setup_design/different_templates_for_the_same_class_and_in_same_section

and I'm sorry for repeating myself, but this is the only thing I need to resolve before going live with my site:

http://www.stavangerkampsport.com/index.php
(Norwegian)

I have a class named 'profil' where I store information about members in our club. This is used for the 'Instruktører' and 'Styret' pages.

I need to use two different templates for showing content in the 'profil' class, as I wish to display different information in the two pages.

I tried, as described in my previous post, to add this to the override.ini:

[line_profil2]
Source=node/view/line.tpl
MatchFile=line_profil2.tpl
Subdir=templates
Match[parent_node]=65
Match[class]=16

[line_profil]
Source=node/view/line.tpl
MatchFile=line_profil.tpl
Subdir=templates
Match[class]=16

Where '65' is the node_id of the 'Styret'-folder.

Please, please help me out...

Alex Jones

Thursday 24 July 2003 9:34:45 am

This is a longshot, but you may want to try putting Match[class] above Match[parent_node].

Also, have you made sure to clear the ini and template caches?

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

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

Kjerand Pedersen

Thursday 24 July 2003 9:37:24 am

I've already tried this, but it didn't work.

Thanks for your reply though :-)

Alex Jones

Thursday 24 July 2003 9:39:19 am

Okay, another idea... try changing:
Source=node/view/line.tpl
to :
Source=line.tpl

and clear the caches.

Alex

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

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

Kjerand Pedersen

Thursday 24 July 2003 9:43:45 am

No, that didn't work either :-(

Jerry Jalava

Thursday 24 July 2003 10:08:01 am

Hi,

What if you ad Match[section]=10 to the [line_profil2] or [line_profil] instead of the "parent_node"? Where 10 is the number of you profil2 (if you putted it in [line_profil2]) section...

They both have to have different sections for this to work... ;)

I use this section trick to make different full and line files for same class...

Hope this helps,
Jerry

Kjerand Pedersen

Thursday 24 July 2003 11:17:35 am

I tried this, but there's another problem...

I save the content of the class in the 'Instruktør' folder and add location to the 'Styret' folder. So it still uses the same template. However, if I create a new object with the Profil-class and store it in the 'Styret' folder, it uses the correct template.

You see, an instructer can also be a member of the board, so I need to keep them in one place, so I don't have to update the same information in several locations.

Oh, please, let there be a solution to this :-| :-)

Thanks for all help so far

Kjerand Pedersen

Thursday 24 July 2003 12:40:19 pm

I gave up on using different templates and instead just put the code I had in my line_styret template into the loop-section in my node_styret template.

It works, although it's not the ideal way to do it.