I've got multiple websites in 1 Umbraco installation. Each website has it's own nodes and content, but now the customer wants to have some general pages that apply to all the websites. What's the best way to do this? I can create a General topnode outside of all the websites and store the content in there, but how can I use those pages on all the websites? Perhaps select them with the Multi Node Tree Picker, but how will that go for the url's? Any good ideas?
In the past I have done it exactly in that way however the section that contains those pages have been hidden using umbracoNaviHide property and I have created a separate doc type for that reusable content and excluded it from any sitemaps , navigation and search indexes. So basically its there and published but you cannot see if from the front end.
If you have 3 sites each one needs to use this reusable page for arguments sake its the disclaimer page. You create that in the reusable area. Create 3 disclaimer pages in your sites and link to the disclaimer page in reusuable area (you could even you relations then your look up will be quicker). In your page template before writing out content check you have a linked page, if you have it then get content from there if not then display content in current page.
yes they are however just empty stub placeholder pages i cant think of another way todo it, unless maybe you add alternate urls in the magic alternate url field for that shared content not sure if that has any seo implications.
"Add the umbracoInternalRedirectId property alias to your document type with a content picker and Umbraco will load the selected page’s content transparently; no url redirection"
So you could have section outside of your main websites for all shared content. Then create pages within the website with the above property with a Content Picker datatype. Then the user can select one of the general pages and have the content seemlessly displayed within the main website.
That won't work because the content needs to "copied" to other nodes without selecting it. So I create a node in 1 language and it needs to be available in the other languages without using a content picker. It somehow needs to be done automatically.
- you create an extra root node to contain all common pages - you link those pages into each site using content pickers or multi-nodes tree pickers
Then a normal page say /en/about-us would link to /common/whatever.
If you want the url to be /en/whatever then you need to a) use your own custom NiceUrl to replace "common" by "en" and b) use some rewriting to replace "en" back to "common".
But if you want the "whatever" to change depending on sites... then I don"t see how you can do it without creating nodes in each sites, maybe using the umbracoInternalRedirectId trick to avoid duplicating content.
@Jerouen - "That won't work because the content needs to "copied" to other nodes without selecting it."
So do that in an event handler that hooks into the publish event? In the handler create a new page (using the Document API) that has the umbracoInternalRedirectId property point back to the id of the page being published. If there's a logical connection between the two pages (which there has to be if you want it to be automatic) then that would work, and the content in the "child" page would always mirror the content in the "parent" page.
General pages with multiple websites
Hello,
I've got multiple websites in 1 Umbraco installation. Each website has it's own nodes and content, but now the customer wants to have some general pages that apply to all the websites. What's the best way to do this? I can create a General topnode outside of all the websites and store the content in there, but how can I use those pages on all the websites? Perhaps select them with the Multi Node Tree Picker, but how will that go for the url's? Any good ideas?
Jeroen
Jeroen,
In the past I have done it exactly in that way however the section that contains those pages have been hidden using umbracoNaviHide property and I have created a separate doc type for that reusable content and excluded it from any sitemaps , navigation and search indexes. So basically its there and published but you cannot see if from the front end.
If you have 3 sites each one needs to use this reusable page for arguments sake its the disclaimer page. You create that in the reusable area. Create 3 disclaimer pages in your sites and link to the disclaimer page in reusuable area (you could even you relations then your look up will be quicker). In your page template before writing out content check you have a linked page, if you have it then get content from there if not then display content in current page.
Regards
Ismail
Hi Ismail,
That's a nice suggestion :). The only problem is I still need to create the pages on all the website and I prefer not to do that.
Jeroen
yes they are however just empty stub placeholder pages i cant think of another way todo it, unless maybe you add alternate urls in the magic alternate url field for that shared content not sure if that has any seo implications.
Regards
Ismail
Anyone else might have another solution for this?
Jeroen
Do you know about the "special" umbracoInternalRedirectId property?
"Add the umbracoInternalRedirectId property alias to your document type with a content picker and Umbraco will load the selected page’s content transparently; no url redirection"
So you could have section outside of your main websites for all shared content. Then create pages within the website with the above property with a Content Picker datatype. Then the user can select one of the general pages and have the content seemlessly displayed within the main website.
That won't work because the content needs to "copied" to other nodes without selecting it. So I create a node in 1 language and it needs to be available in the other languages without using a content picker. It somehow needs to be done automatically.
Jeroen
Interesting. What about this:
- you create an extra root node to contain all common pages
- you link those pages into each site using content pickers or multi-nodes tree pickers
Then a normal page say /en/about-us would link to /common/whatever.
If you want the url to be /en/whatever then you need to a) use your own custom NiceUrl to replace "common" by "en" and b) use some rewriting to replace "en" back to "common".
But if you want the "whatever" to change depending on sites... then I don"t see how you can do it without creating nodes in each sites, maybe using the umbracoInternalRedirectId trick to avoid duplicating content.
?
@Jerouen - "That won't work because the content needs to "copied" to other nodes without selecting it."
So do that in an event handler that hooks into the publish event? In the handler create a new page (using the Document API) that has the umbracoInternalRedirectId property point back to the id of the page being published. If there's a logical connection between the two pages (which there has to be if you want it to be automatic) then that would work, and the content in the "child" page would always mirror the content in the "parent" page.
is working on a reply...