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

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

February 13, 2009 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.

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.

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
Latest Stories
in Your Inbox

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

More From Progress
progress-next-logo
ProgressNEXT: Premier Event for Modern Application Development
Read More
 
sitefinity-11-1-webinar
Seven Reasons to Check Out Sitefinity 11.1
Read More
 
omnichannel
Getting Started with Your Omnichannel Content Strategy
Read More