Forums / Developer / Does Match[parent_node] work???

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

eZ debug

Timing: Jan 18 2025 18:29:16
Script start
Timing: Jan 18 2025 18:29:16
Module start 'content'
Timing: Jan 18 2025 18:29:16
Module end 'content'
Timing: Jan 18 2025 18:29:16
Script end

Main resources:

Total runtime0.2080 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.7109180.8359
Module start 'content' 0.00550.0043 768.546997.8672
Module end 'content' 0.00970.1982 866.4141527.7734
Script end 0.2079  1,394.1875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00331.5766200.0002
Check MTime0.00130.6425200.0001
Mysql Total
Database connection0.00070.336510.0007
Mysqli_queries0.158776.29501410.0011
Looping result0.00150.73931390.0000
Template Total0.197995.110.1979
Template load0.00080.370710.0008
Template processing0.197194.774710.1971
Override
Cache load0.00050.255310.0005
Sytem overhead
Fetch class attribute can translate value0.00090.412110.0009
XML
Image XML parsing0.00030.122210.0003
General
dbfile0.00452.1819200.0002
String conversion0.00000.002930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs