Custom Blog Post Designer

Posted by Community Admin on 04-Aug-2018 17:06

Custom Blog Post Designer

All Replies

Posted by Community Admin on 12-Feb-2013 00:00

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?

Posted by Community Admin on 15-Feb-2013 00:00

Any ideas about this?

Posted by Community Admin on 20-Feb-2013 00:00

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

Posted by Community Admin on 21-Feb-2013 00:00

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.

This thread is closed