+1-888-365-2779
Try Now
More in this section

Forums / Suggestions / options on generic content control

options on generic content control

2 posts, 0 answered
  1. Vangelis
    Vangelis avatar
    153 posts
    Registered:
    07 Jan 2006
    09 Sep 2007
    Link to this post
    Hi,

    I think it would be nice to have some extra options on Generic Content control besides just entering content.  One use could be to make a content to display or not while it is on the page. This would help to have content on a page - remove them temporarily and when needed it would show up again. There are some times where offers come and after some time could be removed. Also this would help in case of registered users that would have the option to see content on a page that is not available to public.

    Also this could prevent page design since there would not be the need to remove anything that is not used from a page.

    Best regards

    Vagelis

  2. Vlad
    Vlad avatar
    498 posts
    Registered:
    15 Jul 2016
    11 Sep 2007
    Link to this post
    Hi Vagelis,

    Thank you for the suggestions.
    Actually, we have plans to implement a similar functionality, not only for GenericContent control. But this task is not scheduled yet.

    In the upcoming SItefinity 3.1 you could create a User Control, which wraps existing GenericContent control, and implement your custom logic there. The User Control should implement IContentContainer interface and its Content property should have an appropriate WebEditor attribute. For example:

    ExtGenericContent.ascx:
    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ExtGenericContent.ascx.cs" Inherits="UserControls_ExtGenericContent" %> 
    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls" TagPrefix="sfWeb" %> 
     
    <sfWeb:GenericContent runat="server" ID="GenericContent1" /> 


    ExtGenericContent.ascx.cs:
    using System;  
    using System.Data;  
    using System.Configuration;  
    using System.Collections;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
    using System.Web.UI.WebControls.WebParts;  
    using System.Web.UI.HtmlControls;  
    using Telerik.Cms;  
    using Telerik;  
    using Telerik.Cms.Engine.WebControls;  
    using System.ComponentModel;  
    using Telerik.Cms.Web.UI;  
     
    public partial class UserControls_ExtGenericContent : System.Web.UI.UserControl, IContentContainer  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
        }
        #region IContentContainer Members  
     
        [Browsable(false)]  
        [WebEditor("Telerik.Cms.Engine.WebControls.HtmlContentEditor, Telerik.Cms.Engine")]  
        [TypeConverter(typeof(StringConverter))]  
        public object Content  
        {  
            get 
            {  
                return this.GenericContent1.Content;  
            }  
            set 
            {  
                this.GenericContent1.Content = value;  
            }  
        }  
     
        public string ProviderName  
        {  
            get 
            {  
                return this.GenericContent1.ProviderName;  
            }  
            set 
            {  
                this.GenericContent1.ProviderName = value;  
            }  
        }
        #endregion  
    }  
     


    In the current Sitefinity version 3.0 the above implementation with User Control does not work. Instead of User Control you should use a compiled WebControl.

    Best wishes,
    Vlad
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered