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

Forums / Developing with Sitefinity / ControlDesigner value populating into a Blog Repeater

ControlDesigner value populating into a Blog Repeater

6 posts, 0 answered
  1. Luke Horan
    Luke Horan avatar
    20 posts
    Registered:
    02 May 2010
    07 Oct 2010
    Link to this post
    Hi
    I'm trying to get a value from the Explicit Links area in the Blogs ControlDesigner to populate into a hyperlink field in the Blogs repeater.

    Does anyone know how to access these values in the onItemDataBound Event in the usercontrol.

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    07 Oct 2010
    Link to this post
    Hi Luke,

    These are public properties of the control

    • SingleItemUrl
    • ReturnUrlPersistance
    • ItemListUrl
    • AllowLinksToPrevNextItem
    that are implemented in the base class - ContentView. If you have a custom class that inherits from BlogPosts or you have an instance of it you could access these properties directly.

    You cannot access these values in a user control if you do not have EventsView declared in it.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Luke Horan
    Luke Horan avatar
    20 posts
    Registered:
    02 May 2010
    08 Oct 2010
    Link to this post
    Hi Ivan,

    I'm inheriting from Blogposts and can't see any of the public properties.

    I'm lost in what you mean by EventsView being declared in the user control.

    Cheers
    Luke
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Oct 2010
    Link to this post
    Hi Luke,

    The properties are there - they are implemented in the base class.

    sample

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.Blogs.WebControls;
    using Telerik.Cms.Engine.ContentViewFiltering;
    using Telerik.Cms.Engine;
     

    public class BlogPostsSitefinity : BlogPosts
    {

        public override string SingleItemTemplatePath
        {
            get
            {
                return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageDetail.ascx";
            }
            set
            {
                base.SingleItemTemplatePath = value;
            }
        }
     
        public override string ItemListTemplatePath
        {
            get
            {
                return "~/Sitefinity/Admin/ControlTemplates/Blogs/Modes/ListPageMaster.ascx";
            }
            set
            {
                base.ItemListTemplatePath = value;
            }
        }
     
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
     
            var url = this.SingleItemUrl;
            var rup = this.ReturnUrlPersistance;
            var itemlisturl = this.ItemListUrl;
            var allowprevurl = this.AllowLinksToPrevNextItem;
     
        }
    }


    The properties are virtual, so you can override them.

    I meant - BlogPost, not EventsView which can be declared in a user control and then you can access the properties of the control in Page_Load of your user control.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Luke Horan
    Luke Horan avatar
    20 posts
    Registered:
    02 May 2010
    08 Oct 2010
    Link to this post
    Thanks Ivan,
    Not sure what is going on but can't seem to get it to work,

    They are there in the inherited class and I can see them in debug, but I've got no values populating through to the user control. The only thing I can see is a constant

    will have to try another way of getting it to work as I'm so frustrated looking at this.

    Cheers
    Luke
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Oct 2010
    Link to this post
    Hello Luke,

    These properties are not constant, they are public virtual properties which you can override.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
6 posts, 0 answered