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:
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:
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?