Jeff Wallace
Aug 10, 2012
  3771
(0 votes)

Multisite Publish Plug-in

Based on CMS 6 R2

Many EPiServer customers today have an enterprise environment allowing them to manage multiple sites from a single EPiServer instance with the possibility of sharing content and functionality between them.  In some cases this may be as simple as a main corporate site and a separate mobile site or the corporate Facebook page.  In other cases there may be many micro, or other, sites.

EPiServer’s out-of-the-box capabilities make sharing content between these sites extremely easy at the smaller content item level (e.g.  Property), the page level, etc.  When content is updated in the “master” location it is automatically reflected across others.  In some cases overriding at another level is also easily possible.

The request to publish an entire piece of content (e.g. a page) from one site to many others at the same time is becoming increasingly common,  and hopefully, I’m about to make it even easier.

Several months ago myself and a couple of colleagues were locked in a room coding up a storm for a demo and my old friend Paul Smith whipped up a module that utilized categories, a scheduled job, and some configuration in web.config to push content to different sites.  At the time this was exactly what we needed.  While considering this recently I decided to dig up the code and remove some of the complexities to simplify it.  The idea was to provide more of an “on demand” approach, removing the use of categories, but still providing the multisite publish feature.  So, here is is:

 

First, the web.config contains a new section that allows you to set up as many other site nodes as you want to be able to share content with.  This can be nodes on the same site, separate sites being managed by the same EPiServer instance, etc.  Give it a logical name, set the destination page ID, and optionally set Page Type you’d like it to use on the destination site.  If you don’t set a Page Type it will use the same type as the current page.

   1: <multisitepublishing>
   2:     <multisites>
   3:         <add name="Customer Zone News" destinationPageId="495" pageTypeName="[AlloyTech] News item"/>
   4:         <add name="Alloy Mobile News" destinationPageId="488" pageTypeName="[MobilePack] Standard Page"/>
   5:     </multisites>
   6: </multisitepublishing>

In Edit Mode, when a content item is selected, you’ll see a new tab with the “Multisite Publish” heading.  The site nodes listed in the config above will be presented as checkboxes in this UI.  To publish the current content item to these other locations simply check the ones you want to publish to and select the “Publish to Sites” button.

image

…and voilà, you’re done.  Simple!  A new content item will be created below the previously specified site nodes and will respect whatever styling is set for that area of the site.  You will note that the current implementation does not create a copy of the data but uses the Fetch Data feature in EPiServer to retrieve from the same data source.  This means an update to the content in the master location will result in a change reflected everywhere this content is being re-used.  Of course, you could change this to an alternate method of your preference, but re-using the content was the goal here.  As you probably know Fetch Data also lets you override individual content items on the fetching page when needed so this would still be possible here.

Customer Zone News:

image

Alloy Mobile News:

image

This could easily be extended with a fancier UI, the web.config settings replaced with a page selector property added in Edit Mode, a scheduling option, saving the state of the areas you published to, and much more.  However, I believe this is a great starting point for your multisite publish needs.

The tagging, shared Block, and Display Template features in the upcoming CMS 7 release will surely provide some enhanced possibilities.

Thanks to Paul Smith for providing the code to read the config, create the new content item, and fetch the data making my life much easier. Smile

How do you get it?

I’ve uploaded it to the EPiServer Nuget feed here.  You can also download the Nuget package here and install manually if you desire: Download.  The EPiServer Nuget feed is probably safest to ensure you get any updates that might come later.

Aug 10, 2012

Comments

Arild Henrichsen
Arild Henrichsen Aug 13, 2012 08:22 AM

This looks promising Jeff, can't wait to try it. I have a customer looking at different cross-publish possibilities now.

Aug 13, 2012 05:49 PM

Great to hear Arild!

Kjetil Simensen
Kjetil Simensen Aug 14, 2012 01:05 PM

Looks great!

Why not use GuiPlugIn settings to configure destination pages so that this can fully be controlled by the customer without having to access a config file on the server?

Aug 16, 2012 07:18 PM

Hi Kjetil, that's definitely a possibility and a great suggestion. This is intended to be a starting point for an idea that people can take and build upon. Making this configurable by the customer would be an excellent (and logical) next step.

Please login to comment.
Latest blogs
Opti ID overview

Opti ID allows you to log in once and switch between Optimizely products using Okta, Entra ID, or a local account. You can also manage all your use...

K Khan | Jul 26, 2024

Getting Started with Optimizely SaaS using Next.js Starter App - Extend a component - Part 3

This is the final part of our Optimizely SaaS CMS proof-of-concept (POC) blog series. In this post, we'll dive into extending a component within th...

Raghavendra Murthy | Jul 23, 2024 | Syndicated blog

Optimizely Graph – Faceting with Geta Categories

Overview As Optimizely Graph (and Content Cloud SaaS) makes its global debut, it is known that there are going to be some bugs and quirks. One of t...

Eric Markson | Jul 22, 2024 | Syndicated blog

Integration Bynder (DAM) with Optimizely

Bynder is a comprehensive digital asset management (DAM) platform that enables businesses to efficiently manage, store, organize, and share their...

Sanjay Kumar | Jul 22, 2024

Frontend Hosting for SaaS CMS Solutions

Introduction Now that CMS SaaS Core has gone into general availability, it is a good time to start discussing where to host the head. SaaS Core is...

Minesh Shah (Netcel) | Jul 20, 2024

Optimizely London Dev Meetup 11th July 2024

On 11th July 2024 in London Niteco and Netcel along with Optimizely ran the London Developer meetup. There was an great agenda of talks that we put...

Scott Reed | Jul 19, 2024