+1-888-365-2779
Try Now
More in this section
Categories
Bloggers
Blogs RSS feed

Working with selectors(WebEditors) part 3. Blog selector and Newsletters group selector.

by Ivan Dimitrov

1. Blog selector( web editor)

This web editor is useful if you want to select some of the blogs you have already created.

Example:

Here we are creating an user control where we add BlogPosts control.

 

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebEditor.ascx.cs" Inherits="CustomControls_WebEditor" %> 
<%@ Register Assembly="Telerik.Blogs" Namespace="Telerik.Blogs.WebControls" TagPrefix="blogs" %> 
 
<blogs:BlogPosts ID="BlogPosts1" runat="server" ParentIDs="" />

 

We put the WebEditor in the code behind and use the value to show our blog. Under methods

region you can create a new instance of BlogManager and pass the ID of the WebEditor.

 

using System;
using System.Web.UI;
using Telerik.Cms.Web.UI;
using System.ComponentModel;
using Telerik.Rss;
using Telerik.Framework.Web.Design;
using Telerik.Cms.Engine;
using Telerik.Cms;
using Telerik.Blogs;
 
public partial class CustomControls_WebEditor : System.Web.UI.UserControl, ITextControl
{
    #region Methoods
 
 protected void Page_Load(object sender, EventArgs e)
    {
 if (selectedBlogs != null)
        {
            BlogManager ctman = new BlogManager();
            IBlog blog = ctman.GetBlog(selectedBlogs[0]);
            BlogPosts1.ParentIDs = selectedBlogs;
        }
 
    }
 
    #endregion
 
    #region Properties
 
    [TypeConverter("Telerik.Blogs.WebControls.SelectedBlogsConverter, Telerik.Blogs")]
    [WebEditor("Telerik.Blogs.WebControls.BlogsSelector, Telerik.Blogs")]
 public Guid[] SelectedBlogs
    {
 get 
        {
 return this.selectedBlogs;
        }
 set 
        {
 this.selectedBlogs = value;
        }
    }
 private Guid[] selectedBlogs;
 
    #endregion
 
}
 
 

 

 

SelectedBlogs

 

 

 

As a result a Guid is returned.

 

2.Newsletters group selector - it returns all newsletter groups you have already created.

Example:

[WebEditor("Telerik.Notifications.Newsletters.WebControl.GroupSelectionList, Telerik.Notifications")]
    [TypeConverter("Telerik.Framework.Utilities.GuidArrayConverter, Telerik.Framework")]
 public Guid[] SubscriberGroups
    {
 get { return subscriberGroups; }
 set { subscriberGroups = value; }
 
    }
 
 private Guid[] subscriberGroups;

 

Subscribers

 

As a result a Guid is returned.

2 comments

Leave a comment
  1. Colin Bowern Feb 16, 2009
    How about one of these fancy selectors for the forums too? :)

    On a related note there was a comment a few releases back to focus on the CMS versus the modules.  I'm starting to see some inconsistencies in module functionality with examples like this.  It would be great to split efforts into a core CMS development and modules.  Work on the modules on a different release cycle and publish them to a marketplace in a manner similar to Firefox addons.  That way we can offer up our own implementations of these modules.
  2. Paul Markham Sep 24, 2009
    Is there a search index selector?

    Leave a comment