Working with selectors Part One: Content selector, Image selector, Document selector.

December 26, 2008 Digital Experience

 

I'm going to start a session of some posts about selectors in Sitefinity. There won't be a lot of coding, because I will describe some general aspects of the topic. In this post I will work with user control and selectors will be set as a properties of this control.

We will define selectors in the code behind of our user control.

1. Content selector.

 

Content Selector

As a result the Guid of a selected item will be returned. You can browse from Generic_Content, News,

Blogs, Images and Documents, Events.

#region Properties
 
 //content selector 
    [WebEditor("Telerik.Cms.Engine.WebControls.ContentSelector, Telerik.Cms.Engine")]
 public Guid SelectContent
    {
 get 
        {
 return this.selectContent;
        }
 set 
        {
 this.selectContent = value;
        }
    }
 //declare Provider Name property 
 public virtual string ProviderName
    {
 get 
        {
 return this.providerName;
        }
 set 
        {
 this.providerName = value;
        }
    }
 
 private Guid selectContent;
 private string providerName = string.Empty;
 
#endregion

 

2. Image and document selectors

 

Image selector

 

Document Selector

 

 //image selector 
    [WebEditor("Telerik.Libraries.WebControls.ImageSelector, Telerik.Libraries")]
 public string SelectImage
    {
 get 
        { return this.image; }
 set 
        { this.image = value; }
    }
 private string image;
 
 //document selector 
   [WebEditor("Telerik.Libraries.WebControls.DocumentsSelector, Telerik.Libraries")]
 public string SelectDoc
    {
 get 
        { return this.doc; }
 set 
        { this.doc = value; }
    }
 private string doc;

 

 

Coming soon Part 2 - file manager selector, page id selector, rss feed selector

The Progress Team