RootNode and Bread-crumbs

Author Message

Lachy Laycock

Tuesday 25 November 2003 8:51:40 am

Hi,

I have recently discovering the wonders of creating multiple sites that can share cascading template sets (with AdditionalSiteDesignList[]), and have uncovered a problem...

My Web host only allows me a fixed number of MySQL DBs and so I have been looking for a way to combine multiple sites with one DB (i believe this was possible for versions <3.2)...

My Solution:
Use the settings variable NodeSettings->RootNode to set the top page.

But alas it doesn't seem to work. So I have managed to create a few work arounds:

1. In the settings/siteaccess/*mysite*/site.ini.append file I set the DefaultPage and IndexPage nodes under my root dir (2) that will be the rootNode for each site. This works fine.

2. Change template links that point to '/content/view/full/2/' to concat("/content/view/full/",ezini('NodeSettings','RootNode','site.ini')

3. Hack the Bread-Crumbs (Path) display to show the RootNode value as 'Home' (NodeID: 2).

This last step I have been unable to do successfully.

I have tracked the source down to the function 'fetchPath' in ezcontentobjecttree.php, and have used the following dirty hack:

$nodePath = $this->attribute( 'path_string' ); [line: 1823]

to

$nodePath = $this->attribute( 'path_string' );
$nodePath = str_replace('/2/', '/', $nodePath);

simply removing the rootNode fixes this but I suspect the rabbit hole goes a little deeper than this and might break something somewhere else...

Does anybody have any ideas or suggesstions as to how this might be accomplished in a less destructive manner?

Regards,
Lachy

Marco Zinn

Wednesday 26 November 2003 3:14:42 pm

Hm, I'm not sure, if i got your setup.
I suspect, that -because your MySQL DB count is limited- you want to put all content into on MySQL DB (for different sites) and let all content start "one level below root", so your sites "virtual root folders" are all children of root (node 2). Right?
When: Why do you want to show the "real" Root-Folder (2) anyway? Any click on that will have your visitors go up one level to much and see all websites...
Better hide the "root"-Folder from path (see my other posting http://ez.no/developer/ez_publish_3/forum/setup_design/toppath_without_root_folder#msg39292) and start with your "virtual home".

Besides that: I think, no version of ezP supports multiple websites in one MySQL DB. In 3.1, it was possible to install multiple "designs" (now: "Packages") into one DB, while the new ez-3.2-installer does not support this.

Note: IMHO, if you really want distinct sites, you will need multple DB's.... how do you want to restrict the search engine, the admin interface etc, when everything is in one large "content tree"?

Marco
http://www.hyperroad-design.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 18 2025 18:34:59
Script start
Timing: Jan 18 2025 18:34:59
Module start 'layout'
Timing: Jan 18 2025 18:34:59
Module start 'content'
Timing: Jan 18 2025 18:34:59
Module end 'content'
Timing: Jan 18 2025 18:34:59
Script end

Main resources:

Total runtime0.7254 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.0068 587.9141152.6250
Module start 'layout' 0.00680.0038 740.539139.4453
Module start 'content' 0.01050.7133 779.9844529.1250
Module end 'content' 0.72390.0015 1,309.109412.1641
Script end 0.7253  1,321.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4810160.0002
Check MTime0.00140.1978160.0001
Mysql Total
Database connection0.00130.176210.0013
Mysqli_queries0.674893.0225540.0125
Looping result0.00060.0794520.0000
Template Total0.690795.220.3453
Template load0.00220.305220.0011
Template processing0.688594.908920.3442
Template load and register function0.00010.019610.0001
states
state_id_array0.00200.269510.0020
state_identifier_array0.00160.214520.0008
Override
Cache load0.00180.2548300.0001
Sytem overhead
Fetch class attribute can translate value0.00070.103220.0004
Fetch class attribute name0.00140.188430.0005
XML
Image XML parsing0.00060.077420.0003
class_abstraction
Instantiating content class attribute0.00000.001730.0000
General
dbfile0.00080.1100160.0000
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
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
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/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: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs