Has RootNode any effect ?

Author Message

Pascal France

Tuesday 23 May 2006 5:11:06 am

Hi,

I would like to define the root node ID from which the menu of the public site will show items.

I tried to change the RootNode setting in content.ini and content.ini.append.php but the root node is always 2. (Reading some old posts, it seems that I am not alone having this problem).

Is it the right way to do what I want and is there a way to define such a node ?

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Kristof Coomans

Tuesday 23 May 2006 11:03:17 pm

Hi Pascal

It is possible to use the rootNode setting, but you will have to modify some templates to use it.

The flat top menu uses a hardcoded value 2 in it's templates. If you replace this with something like

ezini('NodeSettings','RootNode','content.ini')

then you'll get what you want.

But you will probably need to change some other templates too.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Pascal France

Wednesday 24 May 2006 1:12:20 am

Hi Kristof,

Thanks.

In design/base/templates/menu/double_top.tpl I:
* added this first line:

  1 {let id_node_root=ezini('NodeSettings','RootNode','content.ini')}

* changed:

  2 {let root_node=fetch( content, node, hash( node_id, 2 ) )}

to

  2 {let root_node=fetch( content, node, hash( node_id, $id_node_root ) )}

and

  8     {let menuitems=fetch( content, list, hash( parent_node_id, 2,

to

  8     {let menuitems=fetch( content, list, hash( parent_node_id, $id_node_root,

This works for the topmenu (first level) but submenu items are same than first level items (http://www.linuxorable.net/ez_test3.7.5/index.php/prive/)

Could you explain me how does work "var=xxx" in this line, for example:

 13     {section var=menu loop=$menuitems}

Another thing: in pagelayout.tpl, it seems that the top menu is included with:

 75     {menu name=TopMenu}

but I don't understand how it works.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Pascal France

Wednesday 24 May 2006 2:35:18 am

To solve the problem, I have to set $module_result.path[1] to $module_result.path[2] in line 32 and 33

Now, I would like to use my new double_top.tpl only when users are logged in and use the section X
So, I did a pagelayout.tpl override:

  3 [pagelayout]
  4 Source=pagelayout.tpl
  5 MatchFile=my_pagelayout.tpl
  6 Subdir=templates
  7 Match[section]=X

But how can I define that my_pagelayout.tpl use "my_double_top.tpl" ?
I tried {include uri="design:my_double_top.tpl"} instead of {menu name=TopMenu} but of course, it doesn't work.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Pascal France

Wednesday 24 May 2006 4:43:06 am

Hi,

I did a menu extension and now I can assign my "my_double_top" menu to my private siteaccess.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Alexandre Cunha

Friday 21 July 2006 5:25:27 pm

Hi Pascal,

Your solution solves part of a problem I have.
Where I can find the extension you have writen ?

http://AlexandreCunha.com

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 21 2025 15:53:51
Script start
Timing: Jan 21 2025 15:53:51
Module start 'layout'
Timing: Jan 21 2025 15:53:51
Module start 'content'
Timing: Jan 21 2025 15:53:52
Module end 'content'
Timing: Jan 21 2025 15:53:52
Script end

Main resources:

Total runtime0.8052 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 589.0234151.2109
Module start 'layout' 0.00730.0035 740.234436.6484
Module start 'content' 0.01080.7931 776.8828640.9453
Module end 'content' 0.80390.0012 1,417.828115.8516
Script end 0.8051  1,433.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4184160.0002
Check MTime0.00120.1519160.0001
Mysql Total
Database connection0.00120.143110.0012
Mysqli_queries0.722889.7728680.0106
Looping result0.00070.0885660.0000
Template Total0.762894.720.3814
Template load0.00210.256820.0010
Template processing0.760794.475720.3803
Template load and register function0.00020.023410.0002
states
state_id_array0.00120.150410.0012
state_identifier_array0.00100.125520.0005
Override
Cache load0.00180.2237530.0000
Sytem overhead
Fetch class attribute can translate value0.00090.108830.0003
Fetch class attribute name0.00130.167770.0002
XML
Image XML parsing0.00360.446230.0012
class_abstraction
Instantiating content class attribute0.00000.002570.0000
General
dbfile0.00760.9499160.0005
String conversion0.00000.001340.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
18content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 40
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs