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

Forums / Developing with Sitefinity / Custom Blog Post Designer

Custom Blog Post Designer

4 posts, 2 answered
  1. Ernest
    Ernest avatar
    37 posts
    Registered:
    12 Mar 2012
    12 Feb 2013
    Link to this post

    We added bool IsStaffArticle custom field to the blog post module. The goal of this field is to mark a blog post that was posted only by a staff. Then from the blog post control we want to be able to filter all of the posts displayed with this custom field but we want to provide the user an easy way of doing this rather than going to the Advanced settings Filter property of the control.

    We have a custom blog post designer that lives in a separate project. Our goal is to add another property to the Blog Post control, bool IsStaffArticle. We want this property to be available from the designer of the Blog Post control as a checkbox. When this is checked a filter will be applied to the blog post control to filter only blog posts that was marked IsStaffArticle. Our control class inherits from BlogPostView as shown below:

        [RequireScriptManager(true), ControlDesigner(typeof(BlogPostViewDesigner))]
        public class BlogPostView : Telerik.Sitefinity.Modules.Blogs.Web.UI.BlogPostView
        {...

    Then its decorated with our custom blog post designer called BlogPostViewDesigner. Our BlogPostViewDesigner inherits from BlogPostDesigner as shown below:

         public class BlogPostViewDesigner : Telerik.Sitefinity.Modules.Blogs.Web.UI.Designers.BlogsDesigner

    The first time we tried this we're not sure which class we should inherit from. We tried the following without overriding any property and methods:

    Telerik.Sitefinity.Modules.Blogs.Web.UI.Designers.BlogsContentSelectorsDesignerView

    Telerik.Sitefinity.Modules.Blogs.Web.UI.Designers.BlogsListDesigner

    Telerik.Sitefinity.Modules.Blogs.Web.UI.Designers.BlogsDesigner

    and BlogsDesigner happen to work for us. But when we override the LayoutTemplatePath to our custom template we get an error "Object reference not set to an instance of an object.". One of our theory was maybe we grabbed the wrong template from the SDK. We tried both of the template inside this folder but we still cannot get it to work. 

    C:\Program Files\Telerik\Sitefinity 5.3\SDK\Content\Resources\WidgetTemplates\Designers\ContentView\Blogs

    What are we missing here? are we using the wrong template? Are we inheriting from a class?

  2. Ernest
    Ernest avatar
    37 posts
    Registered:
    12 Mar 2012
    15 Feb 2013
    Link to this post

    Any ideas about this?

  3. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    20 Feb 2013
    Link to this post
    Hello Ernest,

    The desired functionality is possible, and is a very good suggestion for a blog post material, actually, thank you very much for bringing up the need for such information. We have just released a blog post on the topic, which covers the desired scenario.

    Hope you find it useful.


    Kind regards,
    Boyan Barnev
    the Telerik team
    Answered
  4. Ernest
    Ernest avatar
    37 posts
    Registered:
    12 Mar 2012
    21 Feb 2013 in reply to Boyan Barnev
    Link to this post

    Thank you for making that blog post available. I made a comment in the blog post about the source code that was provided under the link "here" seems to be not related to that topic. Also we're experiencing a small issue when loading the designer. "Server tag is not well performed", see file attachment. I'm sure we can easily solve this problem but if we can have the correct source code available for download that would be great also.

    Thank you for your great support.

    Answered
4 posts, 2 answered