How do multiple sites with multiple domains work?

Topics: General
Feb 3, 2011 at 8:09 PM

I'm trying to figure out how C1 deals with multiple sites with multiple domains.

If I manage multiple completely separate domains.

www.mysite.com

www.someothersite.com

What's the best way to set up Composite C1 to be able to manage these? Some users should have access to some sites, some users don't. Do I need separate implementations of C1 for each site? What's the best way to proceed?

Coordinator
Feb 9, 2011 at 3:07 PM

I would say it depends on the amount of shared data, functionality and layout and what customizations you anticipate individual sites may require in the future. If the sites are identical in functionality and layout differences can be managed via CSS and layout templates then a single installation may work fine.

The 'acceptable span of diversity' is bigger if the user base is from a single organization. Typically having individual sites will guarantee freedom and simplicity in the implementation, but it may put a burden on the developer who need to update functionality/files across all sites.

Global data or site wide functionality may be a show stopper in relation to running everything on a single installation - for instance the Blog package have authors and tags as global data, making the people that can manage authors/tags able to do so for all sites. This may not be desirable is your user base come from different organizations.

Feb 9, 2011 at 7:43 PM

I'm starting up a quite big project (a couple of thousand pages and images), which consists of a public website and a intranet. Most of the pages share the same functionality and metadata but the UI for pages on website and intranet is very different. The customer wants it to be managed inside a single instance of the CMS so i'm just going head first and see how it goes. I will share all my findings here and suggestions for code changes if that is going to be necessary in the core.

What i'm mostly worried of how to share page types but somehow let the design of the pages be different. I could imagine coming up with some conventions for resolving Templates could ease some of the quirks. Ie. lets say we have a template called Frontpage, and we for each website want to say we want to use the frontpage-template, i don't want to know that there is a site1_frontpage.xml and site2_frontpage.xml. Instead we could have a folder hierarchy insde ~/App_Data/PageTemplates so if you had the following

  • ~/App_Data/PageTemplates/frontpage.xml
  • ~/App_Data/PageTemplates/site2/frontpage.xml

and a page configured to use the Frontpage template, then the actual xml file would be resolved at runtime based on which one of the sites the page belongs to. Yes, i know this isn't supported by the C1 console, but by editing the files directly in Visual Studio there should be no problems.

Feb 12, 2011 at 2:39 PM

found the first quirk... the built in quick-sitemap xslt function doesn't honor the multiple websites boundaries and just prints out all pages... is working on updating my SiteMapProvider so SiteMap.RootNode will return the correct root in the context of the Request.

Feb 12, 2011 at 8:20 PM
Edited Feb 12, 2011 at 8:20 PM

Extended the logic for my SiteMapProvider so it now correctly handles multiple websites, also updated CompositeC1Contrib to include these changes.

Say we have the following structure in C1

  • Website1 (hostname ws1.com)
    • subpage1
    • subpage2
  • Website2 (hostname ws2.com)
    • subpage5
    • subpage10

With the newest additions its possible to access all the necessary pages like this

  • http://ws1.com
    • http://ws1.com/subpage1
    • http://ws1.com/subpage2
  • http://ws2.com
    • http://ws2.com/subpage5
    • http://ws2.com/subpage10

And most importanly, its NOT possible to do this

  • http://ws1.com/subpage5
  • http://ws2.com/subpage1

Furthermore the SiteMap provider is aware of which website we're browsing so stuff like SiteMap.RootNode will point to the correct page node (Website1 or Website2) in C1. All this also works fine with languages, where the language-code is just appended just after the hostname, but before page urls as usual.

And last, but not least, while the above schema is preferred when the customers are browsing the website, it can be annoying when editing pages i C1, not being able to preview across website boundaries. I've therefor included logic to allow cross-site requests when dataScope=administrated. This means that this is possible

  • http://ws1.com/website2/subpage5?dataScope=administrated
  • http://ws2.com/website1/subpage1?dataScope=administrated

And all rendered urls on the page reflect this as well, when viewing pages in the administrated datascope.

Mar 1, 2011 at 8:31 PM

It seems like there are quite a few caveats for working with C1 across domains... and that it's simpler to keep your sites separate.