Surendra Sharma

Surendra Sharma

Search This Blog

Showing posts with label CMS. Show all posts
Showing posts with label CMS. Show all posts

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.

Monday, October 24, 2016

Reference Guide for Sitecore database

Sitecore Database
Sitecore Database


Sitecore database is one of the least explored area in Sitecore world. Even you will not get enough Sitecore database material on its official website. Knowledge of SQL server and its trick can make Sitecore developers life easy.


I started an articles series that covers all possible database operations that leads and architect have to do.

Here I combined all those tricks and mold into an eBook.

Below are the key topics that this eBook covers

  • It’s not all about items, it’s all about data
  • Sitecore Databases
  • Access items and field values from Database
  • Changing data from database
  • Sitecore Database Backup Script
  • Restore database script
  • Creating Sitecore database backup job
  • Sitecore SQL Server database Maintenance Plans
  • Cleanup Sitecore Database Tables
  • SQL server recommended configuration for hosting Sitecore website
  • Page for testing Sitecore Databases performance
  • Page for getting all Sitecore Databases connections

I tried my best to include all the cases that are associated with Sitecore Databases.

You can read and download this reference guide from here:




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