fetch node by node_path

Author Message

Olav Bringedal

Tuesday 31 May 2005 7:09:59 am

Im trying to fetch a node by name. Hovewer I cannot get the fetch node to work no matter what "node_path" i have used.

http://ez.no/ez_publish/documentation/reference/data_fetching/content/node

ive tried:

/1/4/5
/1/4/5/
/sitename/cat/where/the_node/is
/sitename/cat/where/the_node/is/
/cat/where/the_node/is
/cat/where/the_node/is/

havent tried case-sensitiviy though...

no luck.

can someone please show me an example how to use

fetch ('content', 'node', hash('node_path', "????"))

...and you would get Many Thanks! :)


Senior Consultant
http://Umoe-consulting.no

Steve P

Wednesday 01 June 2005 2:24:04 am

Hi Olav

The example explains how to do this:

{* Fetch node number 42. *}
{let node=fetch( 'content', 'node', hash( 'node_id', 42 ) )}
    
    {* Display the name of the node. *}
    {$node.name}

{/let}

You'll need to provide a node you know exists! Let me know how you get on...

Best

Steve

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

Main resources:

Total runtime1.5383 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.0234152.6250
Module start 'layout' 0.00520.0025 741.648439.4453
Module start 'content' 0.00771.5290 781.0938522.9844
Module end 'content' 1.53670.0015 1,304.07818.1719
Script end 1.5382  1,312.2500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2105160.0002
Check MTime0.00130.0849160.0001
Mysql Total
Database connection0.00080.049910.0008
Mysqli_queries1.492597.0265540.0276
Looping result0.00050.0322520.0000
Template Total1.507498.020.7537
Template load0.00200.133120.0010
Template processing1.505397.860420.7527
Template load and register function0.00010.005110.0001
states
state_id_array0.00070.045610.0007
state_identifier_array0.00080.051820.0004
Override
Cache load0.00170.1099260.0001
Sytem overhead
Fetch class attribute can translate value0.00080.050320.0004
Fetch class attribute name0.00130.082330.0004
XML
Image XML parsing0.00050.035620.0003
class_abstraction
Instantiating content class attribute0.00000.000430.0000
General
dbfile0.00180.1195160.0001
String conversion0.00000.000340.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs