Does Match[parent_node] work???

Author Message

Nicklas Lundgren

Sunday 14 September 2003 10:02:55 am

Hi all,
I am trying to show articles in line-mode in two different ways. However, it does not work.
My problem is that the Match[parent_node] has no effect.
Have anyone had any luck using the Match[parent_node]? Or is there a bug in the 3.1 version?

Detailed description of problem follows:

My code in override.ini.append...

[newsarticle_line]
Source=node/view/line.tpl
MatchFile=newsarticle_line.tpl
Subdir=templates
Match[parent_node]=101
Match[class]=2

...don´t work. Instead, the match shown below takes effect, even though it is placed below [newsarticle_line] in the override.ini.append.

[leftmenu_line_class2]
Source=node/view/line.tpl
MatchFile=leftmenu_line.tpl
Subdir=templates
Match[class]=2

Kind regards,
Nicklas Lundgren

Nicklas Lundgren, Managing Director
Novitell AB, Sweden

Paul Borgermans

Sunday 14 September 2003 11:19:50 am

Take a look at the compiled version of your override.ini file in

var/cache/override

Do you see something for the node there?

If not and you cleared the ini cache, than it is a bug.

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Nicklas Lundgren

Sunday 14 September 2003 12:42:15 pm

Thanks for the fast reply!
Everything looks fine in the compiled version - view snippet below.
I suspect that the key parent_node is not implemented in the kernel. When trying with Match[node] it works fine. However, I really need to use parent_node...

Any suggestion on workarounds?

Kind Regards,
Nicklas Lundgren

--------
else if ( $matchFile == "/node/view/line.tpl" )
{
if ( $matchKeys['parent_node'] == '101' and $matchKeys['class'] == '2' )
{
return 'design/owndesign/override/templates/newsarticle_line.tpl';
}
if ( $matchKeys['class'] == '1' )
{
return 'design/owndesign/override/templates/leftmenu_line.tpl';
}
if ( $matchKeys['class'] == '2' )
{
return 'design/owndesign/override/templates/leftmenu_line.tpl';
}
if ( $matchKeys['class'] == '6' )
...
--------

Nicklas Lundgren, Managing Director
Novitell AB, Sweden

Nicklas Lundgren

Sunday 14 September 2003 12:58:22 pm

There is probably a bug here.
I inserted the following code in the compiled version of override.ini.append:
-------
foreach($matchKeys as $m=>$v){
echo($m." is ".$v."<br />");
}
-------
The result was very clear. Every instance of parent_node has the value 2. View snippet below:
-------
section is 10<br />object is 126<br />node is 100<br />parent_node is 2<br />class is 1<br />view_offset is 0<br />viewmode is full<br />depth is 2<br />section is 10<br />object is 137<br />node is 111<br />parent_node is 2<br />class is 2<br />view_offset is 0<br />viewmode is full<br />depth is 2<br />
section is 10<br />object is 126<br />node is 100<br />parent_node is 2<br />class is 1<br />view_offset is 0<br />viewmode is full<br />depth is 2<br />section is 10<br />object is 126<br />node is 100<br />parent_node is 2<br />class is 1
-------

Does anyone know from where in the Kernel, the compiled file is called?

Regards,
Nicklas Lundgren

Nicklas Lundgren, Managing Director
Novitell AB, Sweden

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.