Share » Forums » Developer » Multiple Sites, RootNodeDepth, and...

Multiple Sites, RootNodeDepth, and $module_result.path

Multiple Sites, RootNodeDepth, and $module_result.path

Tuesday 19 May 2009 4:41:25 pm - 3 replies

Modified on Tuesday 19 May 2009 4:42:41 pm by Jordan Hirsch

Author Message

Steven E. Bailey

Tuesday 19 May 2009 11:15:50 pm

site.ini
[SiteSettings]

IndexPage=/content/view/full/100
DefaultPage=/content/view/full/100

admin siteaccess - contentstructuremenu.ini
[TreeMenu]
RootNodeID=100

This alone works for us on a 4.01 installation... with 100 being a child of node 2.

Although I don't know if that fixes your specific problems. We override that node and have a custom pagelayout for the other root node and don't run into these kinds of problems.

/1/2/ is always going to be in the path array in the database I think, so you'll have to rewrite templates to take this into account.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

zurgutt -

Wednesday 20 May 2009 1:12:36 am

I have a multisite setup like you are trying to set up.

Short answer - its not that simple. You cannot rely on ini settings only, multiple templates have to be modified.

At first I also thought setting RootNode will do it, but no, setting RootNode to anything else than 2 will mess up the system. Nobody is really sure what it is for, I think, but it should not be touched.

RootNodeDepth is not enough either. It is not available on some pages, and then you get the real root, mightily confusing users.

I have each subsite as extension, there is a folder for each subsite that has folders for content (subsite root), users, media and design (contains copy of site settings object)
Here is rough overview of settings overrides i have for one subsite (you will have different node id's of course)

browse.ini
AliasList[]
AliasList[content]=148
AliasList[users]=149
AliasList[media]=150

content.ini
[NodeSettings]
SubsiteRootNode=148
SubsiteUserRootNode=149
SubsiteMediaRootNode=150
(these values are added by me and used in templates where necessary, instead of relying on RootNode and RootNodeDepth, which dont work like i said)

design.ini
[SiteLookSettings]
SiteLookObjectID=252
(used to locate subsite copy of site settings object)

site.ini
IndexPage=/content/view/full/148/
DefaultPage=/content/view/full/148/
RootNodeDepth=3
DefaultUserPlacement=149

After that you need to modify pagelayout, search, menus, path line, browse template.. maybe something else im not remembering right now.

My setup is 3.9 based, maybe something is improved since but i doubt.

Now, ez publish would be a fantastic system if RootNode setting functioned as one would expect it to function..

Certified eZ developer looking for projects.
zurgutt at gg.ee

André R.

Wednesday 20 May 2009 2:38:39 am

There are some changes, the code that uses RootNodeDepth now clearly states what it is used for:

                  RootNodeDepth is a setting for letting you have a very simple multisite, single database and singe siteaccess setup.
                  The content of the menues will be the same on all system pages like user/login, content/edit 
                  and so on, and also when you surf bellow the defined page_root_depth.
                  The sites will also share siteaccess and thus also the same ez publish design and templates.
                  You can however custimize the design with css using the class on div#page html output:
                  subtree_level_x_node_id_y class

                  Note: It is recommended to turn it of by setting it to 0 for normal sites!

                  Example having 2 or more 'sub-sites' with RootNodeDepth=2:
                    root (menu shows sub sites as menu choices like it will on system pages)
                    - sub site 1 (menu show content of this sub site)
                    - sub site 2 (-- " --)
                    - sub site 3 (-- " --)
                    - sub site 4 (-- " --)
                    - sub site 5 (-- " --)

RootNode should work a bit better as of 4.1. in webin (/ flow) you'll have a ezpagedata operator that calculates all the variables you normally need for a webin site, among others a relative path array based on your rootNode / rootNodeDepth settings. This ($pagedata.path_array) is now used everywhere in pagelayout and its included templates, so should be more consistant now.

But, this:

{def $root_node=fetch( 'content', 'node', hash( 'node_path', '/') )}

Will always return the true root node.
The Root Node settings are used by the templates to make it appear that the site, not the eZ Publish install, has a root page of something else then the real internal root. So don't expect black magic from the api calls / fetch functions.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu