parent_node_id - Where does it come from?

Author Message

RW Wood

Monday 08 September 2003 7:34:42 am

As I'm learning to understand the templating system, I see that the menus on the demo site are generated by fetching content that has parent_node_id set to a number, ie 17 for the news site, 19 for the book corner, etc. However, I don't know how a template designer is supposed to know those numbers without going into the database and tracking them down. Is there some part of the admin database that I'm missing that would show these node numbers?

Additionally, I still don't get the idea of nodes as opposed to a folder structure with child folders and files, etc.

Thanks.
RWW

Bjørn Kaarstein

Monday 08 September 2003 7:49:36 am

You can find this out in the admin interface.

If you create an object (article, folder etc), then you'll have a link to your new object. In the status line you can see i.e. /content/view/full/19 where 19 will be your node number.

You can also get your nodenumber in the templates with {$node.node_id}

Ez has a tree structure, with node 2 as the top node.
Basically, every object can have children objects of different types.

Regards Bjørn

Alex Jones

Monday 08 September 2003 7:50:44 am

-- Looks like Bjørn beat me to hitting the 'Post' button. :) --

You don't have to go into the database. If you look at the content section of the admin area and click on one of the links such as "Book Corner" you will be taken to that node. If you look at the URL in your browser's address bar you will see a number at the end of it which is your node id. Every "page" or "folder" has its own node id; for example, the main node id for the root folder is most likely '2'.

I think of nodes as being far more flexible than a folder structure. Folders in and of themselves are rather useless in this system as any item can act as a container for children. So you can set up a press release that is a child of another press release if you wish. It can be both confusing and powerful. ;)

Hope this helps,

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Hans Melis

Monday 08 September 2003 7:54:30 am

EDIT: I'm even slower ;)

You can see the node id's in the admin interface. Hover the mouse cursor over an object's name, and the url for that object will appear in the status bar. The node id is after /content/view/full/

However, when click the "Edit" picture, it won't show the node id in the address bar, but the object id.

Nodes serve as a container for objects. Each node has some attributes, and an object enclosed in it. In the most simple structure, you will indeed only have folders that create the structure. But with the node system, you can put anything anywhere in the content tree. With the folder system, you'd be restricted to placing content as a child of a folder.

You can simulate the folder system with the roles though. Content; Create; ParentClass(Folder) as permission should do the trick.

--
Hans

Hans
http://blog.hansmelis.be

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 31 2025 06:24:07
Script start
Timing: Jan 31 2025 06:24:07
Module start 'layout'
Timing: Jan 31 2025 06:24:07
Module start 'content'
Timing: Jan 31 2025 06:24:07
Module end 'content'
Timing: Jan 31 2025 06:24:07
Script end

Main resources:

Total runtime0.0147 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.2500151.2266
Module start 'layout' 0.00580.0023 739.476636.6797
Module start 'content' 0.00810.0052 776.156394.1875
Module end 'content' 0.01330.0014 870.343833.9922
Script end 0.0147  904.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002517.3414140.0002
Check MTime0.00117.6785140.0001
Mysql Total
Database connection0.00096.016810.0009
Mysqli_queries0.002517.341430.0008
Looping result0.00000.061710.0000
Template Total0.00117.410.0011
Template load0.00085.689110.0008
Template processing0.00021.681110.0002
Override
Cache load0.00064.137810.0006
General
dbfile0.00128.087480.0001
String conversion0.00000.048740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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