{if $node.object.main_node.parent_node_id|eq ( '554' )} ?

Author Message

John Kazakis

Friday 09 May 2008 3:43:44 am

Hello,

I need to be able to show certain items if the user is a specific part of the site (in this case parent node 554).

I've tried using the code below but it doesn't work.

{if $node.object.main_node.parent_node_id|eq ( '554' )}
     <p> this is 554 </p>
{/if}

Is there another way of doing this, or is there something wrong in my code?

Thanks.

Felix Laate

Friday 09 May 2008 4:27:32 am

Hi John,

try

{if eq( $node.object.main_node.parent_node_id, 554 )}
    <p> this is 554 </p>
{/if}

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Gaetano Giunta

Friday 09 May 2008 4:29:29 am

Not sure about the intended results, but if you fetch the main_node of the current object you might not be identifying the actual node being viewed - eg. in case the given object is published at two different locations. Why not just use $node.parent_node_id?

Principal Consultant International Business
Member of the Community Project Board

John Kazakis

Friday 09 May 2008 4:49:07 am

Felix, that worked fine. Thanks.

Simple syntax error?

I have a content class(reports), this class is used throughout the site and it's also present in certain member-only pages.

However there is a Free Reports section that also uses this same class, so I want to allow people to download these reports only in that section.

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:16:42
Script start
Timing: Jan 18 2025 19:16:42
Module start 'layout'
Timing: Jan 18 2025 19:16:42
Module start 'content'
Timing: Jan 18 2025 19:16:43
Module end 'content'
Timing: Jan 18 2025 19:16:43
Script end

Main resources:

Total runtime0.9986 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.0469152.6406
Module start 'layout' 0.00580.0041 740.687539.4922
Module start 'content' 0.00990.9870 780.1797581.9297
Module end 'content' 0.99690.0016 1,362.109412.1094
Script end 0.9986  1,374.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3557160.0002
Check MTime0.00150.1534160.0001
Mysql Total
Database connection0.00100.102310.0010
Mysqli_queries0.938593.9773620.0151
Looping result0.00080.0837600.0000
Template Total0.961396.320.4807
Template load0.00240.235620.0012
Template processing0.958996.025920.4795
Template load and register function0.00020.016610.0002
states
state_id_array0.00140.140110.0014
state_identifier_array0.00150.153820.0008
Override
Cache load0.00190.1944230.0001
Sytem overhead
Fetch class attribute can translate value0.00100.099230.0003
Fetch class attribute name0.00170.173060.0003
XML
Image XML parsing0.00120.124830.0004
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00200.1968220.0001
String conversion0.00000.001140.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs