Multiple Sites, One Admin, some shared content

Author Message

Andrew K

Tuesday 26 September 2006 9:32:37 am

I've been searching for a while now on how to do this, but haven't come up the the exact answer for my situation.

I'm setting up eZp for my church. They have different ministries for different age groups (kids, students, college, adults, etc). We are trying to set up a siteaccess for each (so they can have their own templates and host addresses) but want the editors to just have to log in to one place to change the content for all of them.

Most of the content will be unique, but some may be shared across sites. Is there a way to have one content tree but make the root nodes different for each site?

i.e.

Top Node
   |- Main (main church site root node: www.church.com)
   |- Kids (kids site root node: kids.church.com)
   |- Students (students site root node: students.church.com)
   |- Etc.

Thanks.

--Andrew

Andrew K

Tuesday 26 September 2006 10:10:36 am

Is PathPrefix the answer?

--Andrew

Claudia Kosny

Tuesday 26 September 2006 2:04:40 pm

Hi Andrew

I have never done something like this but as far as I know you need to set the siteurl, the defaultpage and the indexpage for each siteaccess to the appropiate url/node. Then use path prefix to exclude the names of your root folders fom the path, e.g. if you have a folder each for main, students and kids, you need to remove the names of these folders.

You _don't_ want to touch the rootnode setting in content.ini - this seems to cause quite a lot of havoc.

Don't forget that this is only a pretty weak separation of content. The search engine will list results from the whole content tree. You also have to use subtree limitations or sections to restrict user access to one of your subsites.

Greetings from Luxembourg

Claudia

zurgutt -

Tuesday 26 September 2006 11:14:23 pm

I have just successfully done a very similar site setup.

Its more difficult than it sounds because default templates are not good enough for this and there is some bugs in ez that make it harder than it should be. Namely, they dont take in account the RootNode setting and even if modified to do so the RootNode setting other than 2 will trigger a bug in node url_alias, making pages inaccessible after editing. I have filed a bug about this.

What i did is i created new setting SubsiteRootNode and modified templates to use that for site root. Specificly you have to override and modify menu templates to truncate module.path, also the breadcrumb template and Online Editor templates, if you use that. Also you need to set DefaultPage, IndexPage and PathPrefix for each subsite. Separate subsites into different sections, then it is easier to do permissions and overrides. I have also made a separate Users and Media nodes for each sub, this way subsite admins can manage users and images locally.

Come on #eZpublish channel and Ill try to help you out. Here is a code snippet that might get you going:

From beginning of flat_left.tpl :

{let root_node=fetch( content, node, hash( node_id, ezini( 'NodeSettings', 'SubsiteRootNode', 'subsite.ini' ) ) )
     root_depth=$root_node.path[dec(count($root_node.path))].depth
     result_path=$module_result.path|remove(0, $root_depth)
     docs=treemenu( $result_path,
                    is_set( $module_result.node_id )|choose( $root_node.node_id , $module_result.node_id ),
                    ezini( 'MenuContentSettings', 'LeftIdentifierList', 'menu.ini' ),
                    0, 5 )
                    depth=1
                    last_level=0
                    root_node_array=array( hash('id', $root_node.node_id,
                                                'level', 0,
                                                'url_alias', $root_node.url_alias,
                                                'url', $root_node.url,
                                                'text', $root_node.name,
                                                'is_selected', eq($module_result.node_id, $root_node.node_id)
                                                ) )
                    }
        <ul>
        {section var=menu loop=merge($root_node_array, $:docs) last-value}
...

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

Andrew K

Wednesday 27 September 2006 7:24:50 am

I was actually struggling with the left menu template yesterday trying to get it to work. Thanks for the code, I can see what you are doing. I'll make sure to change the rootnode setting back to 2. Which rootnode settings should I not touch? I think there are a few out there.

--Andrew

zurgutt -

Wednesday 27 September 2006 11:38:38 am

The RootNode in content.ini should not be used. At least until someone looks at this bug: http://ez.no/bugs/view/9021

Its a pity, in some places it is actually used, like in online editor, so if setting it worked there would not be need to modify editor to get it work in subsite.

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

Nabil Alimi

Thursday 28 September 2006 12:44:31 pm

Hi Andrew,

Well I think that siteaccess are exactly used for what you expect to do.

But I also think that it will ask a bit of effort. ;)

You will have as many siteaccess (just like you have siteaccess "plain" you'll have "main" , "kids" , "student" and so on) that sites that you needs + one siteaccess for the admin.

Default roots for each of your sites will be specified in settings/siteaccess/<your_siteaccess>/site.ini.append.php

[SiteSettings]
[...]
SiteName=Church
IndexPage=/content/view/full/1234
DefaultPage=/content/view/full/1234

where 1234 will be the node_id of the root of the Church site.

Each siteaccesses may also have his own templates using a dedicated design.

In fact, I'm working on a project like yours (2 sites 1 admin). That's just the starting point. ;)

If you have any questions, just ask.

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

kavi kavi

Friday 19 January 2007 6:09:19 am

Hi zurgutt !

I've used your code for the flat_left, it works fine. GREAT!!!!!!!!!!!!
I've one tiny problem, you can see it there http://ez.no/community/forum/setup_design/multi_site_and_siteaccess

Thanks !
kavi

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.