This project is read-only.

Sharing content

Topics: Customizing Orchard, General, Troubleshooting
May 16, 2013 at 9:30 AM
Edited May 16, 2013 at 9:36 AM
We have a certain website with a lot of content. Now we need to create kind of sub-sites/portals or however you want to call it. In these 'sub-sites' we need content from the main site, but it also needs to have it's own content. The 'sub-sites' also need to have their own theme.

I know this question has been asked before, several times, but in all those topics I haven't found a fully working solution. What I have found so far is that I shouldn't use multiple tenants, because they are made for isolation and not for sharing content, which is logical. Also, I have found that I can make a module or theme that implements IThemeSelector. So I'm making a single tenant with multiple sections/blogs.

With this I can, for example, check the URL of the current request and pick a theme based on that. This works fine for the parts that have their own content, but not for the shared content, since they have one permalink. Now I figured out that I can add multiple links to one content, with the alias module. However, that is a lot of work, I will have to do that for 50+ pages and that 2 times, since I need at least 2 'sub-sites' and then I would also have to remember to do that for every new page I add in the future.

I know this is not supported out of the box (at least according to this topic from 2010), but I'm looking for any ideas of how I can acoomplish this.

ps. I couldn't think of a proper title for the topic, so I'm sorry if the title is kinda crappy.
May 21, 2013 at 9:14 AM
Does nobody have any ideas? Otherwise I'd have to use a weird/crappy solution like iframes...
May 26, 2013 at 8:29 AM
How do you mark common content? What differentiates the sub sites?
May 27, 2013 at 8:30 AM
I have created a content part with a checkbox and I added this to the Page content type. If the user enables this checkbox, it means that the page should be shared with all the sub-sites. If it's not checked, it's just a common content page. I also made an admin section where admins can add/remove sub sites.
May 28, 2013 at 2:06 AM
So you want those unique and common content items to look different depending on... what?
May 28, 2013 at 3:47 PM
The unique content has to look different depending on which section they are made for and the shared content items have to look different based on the section where the user was on, when he clicked on a link to go to that content item.

I can only do this by looking at the current url (afaik). The homepage of a section will be Any links on that section should be relative to that section. So if we have a shared page called "FAQ", and the user is currently on, the url to the faq page should be At least this is what I'm making now... I don't know any other way to do this.

I don't really care what it all depends on, how to define the sections, I just want to figure out what the best way is to accomplish my goal (it's what the customer wants...) or the least ugly way, if there is no good way.

We also have the idea now to just create multiple tenants and build an external tool to synchronise certain content between those tenants, based on that content part with a checkbox.
May 29, 2013 at 12:14 AM
How do you know the section where the user was on? Referrer? I suppose you could have the theme selector react to referrer headers.
May 29, 2013 at 8:38 AM
I actually hadn't thought of using the referrer. I could indeed use that in the theme selector and select my theme based on that. The only problem with that, is that anyone can turn of referrers in their browser. If a user has it turned off, then you will always get null from the referrer property in It's not a very big problem though, who ever turns that off? Most people probably don't even know about it.
May 31, 2013 at 7:19 AM
I'd say nobody does that. I can see how it could be marginally useful between sites, but within a site? Nah. I wouldn't worry about it, and I don't see any other way to make it work. Well, you could fall back to a session-based thing in those rare cases. You could also intercept the no-referer case and display a special error message explaining what happened.