Skip to main content

Posts

Showing posts from June, 2014

Custom control in Sitecore

Although Sitecore has provided most of the features out of box, yet sometime we need custom control to be created as per project need. In the given example, we will create a custom control "Pubish with media". Purpose of this custom button is to publish the content including media associated with it.

Follow the mentioned steps to make custom control.

Step1:
Create a cs file in your project and name it as "PublishWithMedia.cs". Open the file and write the code. In this example,  we are showing code for publishing media with content item.

using System;
using System.Collections.Specialized; using Sitecore; using Sitecore.Data; using Sitecore.Data.Items; using Sitecore.Diagnostics; using Sitecore.Globalization; using Sitecore.Links; using Sitecore.Publishing; using Sitecore.Shell.Framework; using Sitecore.Shell.Framework.Commands; using Sitecore.Web.UI.Sheer; using Sitecore.Workflows;
namespace MyProject.CustomControl { ///<summary> /// Represents the Publish Item command. ///<…