Test changes without publishing to web DB in Sitecore

In your development environment, did you ever felt that publishing is not providing a great value, but acting like a hindrance?

PublishItem

In Sitecore you can directly test your changes without publishing your changes to web DB, and configure Sitecore to use content from master DB.
This can be done in two ways:

  1. If you don’t have any custom Site configuration config file exist, please go to App_Config/Include/LiveMode.config.example file and rename it to LiveMode.config or
  2. If you have custom Site configuration file exists, you can change the database value to “master” from “web”.

Please make sure to revert your changes, before deploying the solution to QA or production environment.

Happy learning 🙂

 

Unpublishing child items in Sitecore

There are scenarios where we want to unpublish all the child items in Sitecore, and need to publish only few from specific folder/item, this is also required because as a content author we don’t want to delete the items from content tree permanently, but just want to remove it’s reference from web DB, such that when required item can be made available for publishing.

Some examples includes:

  1. Video Repository like Brightcove
  2. Product Repository in Sitecore, whose source is some third party CRM systems.
  3. Employee Repository

Client is not 100% done with all the content authoring, and haven’t reviewed all the content as well, in this case it makes most sense to unpublish all the items, and publish only which is verified by the business and content team, so that only tested content and pages can be made public.

Instead of going to each content item and unpublish one by one, there is an easy to unpublish all the child items at once.
Please follow the below steps to unpublish all child items:

  1. Go to the item in Sitecore for which all child items need to be unpublished.unpublishparentitem
  2. Before we make any updates, please try to browse any child item and make sure that you can browse the page, once this is tested we can move to next step.
  3. Now, go to “Publish”->”Change” option.
  4. From there select “ITEM” tab and uncheck “Publishable” checkbox.
  5. This makes all the child items unpublished.unpublishable
  6. Now publish your parent item,and all child items under it.
  7. Try to load the same child page, and your page status should be 404 now.
  8. Next, go to the parent folder/item again and publish only that item.
  9. Now, go to individual child item(s) and publish only those which are required.
  10. Try to load the page, and this time it should load it as expected.

This way we can keep all content items in Sitecore tree, but doesn’t promote it to web database.

As child items inherit the publish status of the parent item, setting the “Publishable” checkbox to false make sure that items are removed from web.

I hope this will help someone, who is trying to remove all the child item(s), but at the same time, also don’t want to delete items permanently.

Happy learning 🙂