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
More From Progress
d12fcc0bdb669b804e7f71198c9619a7
5 Questions Automakers Should Ask to Improve Asset Uptime
Download Whitepaper
 
SF_MQ_WCM
2018 Gartner Magic Quadrant Web Content Management (WCM)
Download Whitepaper
 
What-Serverless-Means-For-Enterprice-Apps-Kinvey
What Serverless Means for Enterprise Apps
Watch Webinar