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

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

Posted on December 26, 2008 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

 

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.

 WebEditor1

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

 

WebEditor2

Image selector

 

WebEditor3

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;

 

selector1

 

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

progress-logo

The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation