Press enter to see results or esc to cancel.

Sitecore Power Publish

Whenever training our clients on how to use our Sitecore implementations, I always get the same three questions about publishing items in Sitecore:

  • How do I unpublish an item?
  • Where can I see if an item has been published?
  • I have added this image and published my content item, but the image isn’t visible on my website. Can you fix this?

To be honest, I think the Sitecore client and it’s functionality could be improved on this matter. Unpublishing of course is possible, but the way it works is rather development minded: you have to set the item to the Unpublishable state and publish it again… And publishing related items is a logical necessity if you understand the database structure and publishing mechanism fully, but to first time users it can be a mystery and frankly, users never want to only publish their content item without putting their related images and resources live. And viewing the publishing state simply isn’t possible at all (to my knowledge). To be sure an item is published you just have to publish it again. Or look on your live website.

Using this experience, I’ve built a rather simple but effective Sitecore plug-in that simplifies these tasks. After installation the Publish ribbon is extended with three more options:

power-publish-toolbar

Power Publish

First of all, this publish button will force the item being published, regardless the state of the Publishable option on the Item tab in the Publish restrictions, so you can use it to publish items that you’ve unpublished via the Unpublish button of this add-on (it does respect other Publishing restrictions though). But more importantly, this publish button also publishes all resources used by the current item. So if you’ve included media items like an image or a PDF, but forgot to publish them, clicking this button will also publish those items. It even works if you’ve publised the media item itself, but forgot to publish its parent folder…

This function will not publish linked pages in your site that are not published, but only resources like media library items and data sources used in item fields, as those are needed to display the item you want to publish correctly. This method even publishes the templates and layouts used by the current item, if that’s not done yet.

If you are using Sitecore 7, this also works for datasource field values, as they are represented by GUIDs from version 7.0 and up. Older versions of Sitecore store datasources as plain text, hence they are not noted as a reference by Sitecore and thus this plugin will not have any effect on those items.

Unpublish

This button enables you to unpublish an item with a single click. It will change the Publish Restrictions as it unchecks the Publishable option on the Item tab and publishes the item after that, using a full Republish without Subitems.

Publishing State

This gallery button shows the publishing state for all publishing targets. If a publishing target is up-to-date, a green dot is shown. If the item is published to a publishing target, but the item has changed afterwards, an orange dot is shown (so it’s published, but not up-to-date). If the current item is not present in a publishing target at all, a red dot is shown. This function enables the content editor to check into detail if the content is published or not, for every publishing target.

Interested?

I will add the module to the Sitecore MarketPlace and I have published the project under the GNU General Public License on GitHub, located at: robhabraken/sitecore-power-publish.

Comments

Comments are disabled for this post

Rob Habraken

Software Engineer, Technology Director, Senior Consultant, Sitecore MVP and overall technology addict. Specialized in web development, Microsoft technology and, of course, Sitecore.

https://www.robhabraken.nl



Check out the iO tech_hub, our company tech blog with developer oriented articles about all aspects of web development and digital innovation.

https://techhub.iodigital.com/