Surendra Sharma

Surendra Sharma

Search This Blog

Thursday, October 27, 2016

Lifetime and publishing in Sitecore



This post is about lifetime and publishing fields of an item in Sitecore.

Lifetime and publishing fields
Lifetime and publishing fields


If you check standard values of any item, you surely get two section - Lifetime and Publishing.

Lifetime fields

These fields are applied on individual version and language.


  • Valid from - Date and time from which this items version is available on delivery database and hence available for access to front end
  • Valid to - After this Date and time, this item version is removed from delivery database.
  • Hide version - Hide this item version from accessing. Its useful if you have created multilinguaal site and for specific language such as French, you don't want to publish it. So check this checkbox to hide French language version.

Publishing fields

All fields of publishing section are shared. These fields are applied on all versions and languages of an item.


  • Publish - Copy this item at specified datetime to web(delivery) database.
  • Unpublish - Delete this item at specified datetime from web(delivery) database
  • Publishing targets - Copy / Delete this item from selected targets instances delivery databases
  • Never publish - Don't publish this item. In this case item will not copied to your Web database. If item is already published, then this item will be deleted from WEB database.

If you had not published the item yet and now if you specify the datetime in Publish field and marked Publishing targets, then item will be automatically publish around specified date time on specified target delivery instances. Please note this will not published at exact specified date time but somewhere after to specified date time when publish agent will run.

Auto publish will only work if you have specified interval for publish agent in Web.config file as

<!-- Agent to publish database periodically -->
<agent type="Sitecore.Tasks.PublishAgent" method="Run" interval="00:00:00">
  <param desc="source database">master</param>
  <param desc="target database">web</param>
  <param desc="mode (full or smart or incremental)">incremental</param>
  <param desc="languages">en, da</param>
</agent>

Here 00:00:00 means auto publish is disabled. So a value "00:10:00" means run scheduler once in every 10 minutes as

<agent type="Sitecore.Tasks.PublishAgent" method="Run" interval="00:10:00">

I hope you like this Sitecore lesson. Stay tuned for more Sitecore related articles.

Till that happy sitecoring :)

Please leave your comments or share this article if it’s useful for you.

Wednesday, October 26, 2016

How to change style of items in Sitecore



I just love the way Sitecore allow me to customize its UI, change look and feel, override pipeline etc.

Sitecore provides a web UI to user which is ultimately HTML for browser. So everything that is applicable on HTML is also true for Sitecore UI.

There are some important items present in content tree which we need to show to content editor in different format. So sometimes we need to change look and feel of these item in content tree.

Content items in tree are actually <span> inside Hyperlink HTML tags.

Before applying any style, my content tree looks like

Before applying style
Before applying style

For applying style to item,

  • Select item
  • Select Standard fields checkbox in View Tab
  • Open "Appearance" section
  • Put you CSS style into "Style" field.
  • Refresh your content tree.

I am using below style for two items
  • color:red;
  • font-size: 24px;color:orange;background-color:black

Once you put this style and refresh content tree, now my content tree looks like

After Applying style
After Applying style

Sitecore add this style to <span> tags inside hyperlink at runtime as

<span style="font-size: 18px;color:orange;background-color:black"><img src="/temp/IconCache/Applications/16x16/Document.png" width="16" height="16" class="scContentTreeNodeIcon" alt="" border="0">List 2</span>

Style in span
Style in span

I hope you like this Sitecore customization lesson. Stay tuned for more Sitecore related articles.

Till that happy sitecoring :)

Please leave your comments or share this article if it’s useful for you.