Monday, May 2, 2016

Usage of Publishing.PublishEmptyItems Setting

Recently we had a discussion in Sitecore Community forum regarding a template container (template folder) not getting published and it causes the child templates also remove from web database.

The reason for this issue was the template container (template folder item) did not had any language versions defined. It was only an empty item without any versions.

One of friends from community suggested to adjust the Publishing.PublishEmptyItems setting to true, to allow Sitecore to publish empty items.

<!--
    PUBLISHING PUBLISH EMPTY ITEMS
    Specifies whether empty items (i.e. items without publishable versions) should be published.
    Default value: false
-->
<setting name="Publishing.PublishEmptyItems" value="false" />

But, eventhough that setting will solve this above issue mentions, can cause some serious side effects.


Sitecore had bugs related to empty item versions getting created automatically without knowledge of editors.

First senario I faced this was with Sitecore 6.6 release.
In that initial version of Sitecore, when a item created with a other language than 'en' language, Sitecore automatically created an empty item version in 'en' language also. (Sitecore Bug)

Also, recently I saw a same kind of issue on community forum, where empty item versions getting created with Sitecore 8.1 update-1.
https://community.sitecore.net/developers/f/8/t/2616


So, setting the Publishing.PublishEmptyItems setting to 'true' will cause these empty items to be get published.


So, correct way (or best practice) would be to create versions for the Containers/Folders also, which will allow publishing to work accordingly, while keeping the Publishing.PublishEmptyItems setting to "false"


Happy Sitecore!!

No comments:

Post a Comment