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.

eZ debug

Timing: Jan 18 2025 19:13:13
Script start
Timing: Jan 18 2025 19:13:13
Module start 'layout'
Timing: Jan 18 2025 19:13:13
Module start 'content'
Timing: Jan 18 2025 19:13:14
Module end 'content'
Timing: Jan 18 2025 19:13:14
Script end

Main resources:

Total runtime0.8397 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.0313152.6250
Module start 'layout' 0.00640.0025 741.656339.4453
Module start 'content' 0.00890.8293 781.1016570.6875
Module end 'content' 0.83810.0015 1,351.789116.1641
Script end 0.8397  1,367.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4013160.0002
Check MTime0.00130.1555160.0001
Mysql Total
Database connection0.00080.095710.0008
Mysqli_queries0.771691.8894600.0129
Looping result0.00070.0781580.0000
Template Total0.808096.220.4040
Template load0.00180.220220.0009
Template processing0.806196.002120.4031
Template load and register function0.00010.013210.0001
states
state_id_array0.00090.107110.0009
state_identifier_array0.00120.148620.0006
Override
Cache load0.00170.1998740.0000
Sytem overhead
Fetch class attribute can translate value0.00060.067520.0003
Fetch class attribute name0.00090.112360.0002
XML
Image XML parsing0.00130.150220.0006
class_abstraction
Instantiating content class attribute0.00000.001880.0000
General
dbfile0.00170.2080240.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs