Orchard CMS Related Blog Posts Custom Module

Orchard CMS Related Blog Posts Custom Module

One of the most popular features included with Orchard CMS is the blogging engine. I personally love to blog in order to share my knowledge and experiences with my fellow .NET Developers whenever possible. During the past week while on vacation I received a request from one of my closest clients that they needed a Related Blog Posts Custom Orchard Module. This is a custom module I have wanted to create for myself for quite a long time, so I came out of holiday hiding for a couple days to create a quick custom module for Orchard that allows a blogger to assign related blog posts to a blog post in Orchard CMS.

Related Blog Posts Custom Orchard Module

This was a fun custom Orchard Module to create for a few reasons. First, it has to do with blogging in Orchard. As I said, I love blogging as both a way to market my development services as well as a way to share knowledge with other Orchard developers. Second, it involved a lot of JavaScript and jQuery. I love leveraging the power of JavaScript and jQuery whenever possible to provide a more responsive and user-friendly interface. With this Orchard Module, I leveraged JavaScript and jQuery quite a bit on the front-end for drag-and-drop sorting; AJAX to the Orchard Web Server; and various appending, removing, and animation to provide a pleasant interface for the Orchard Website.

Shown below is an image of the Related Blog Posts Custom Orchard Module ( Content Part ) that allows a blogger to associate specific Orchard Blog Posts with a blog post. I can think of others ways to pull off this functionality, but my client was very specific about the Content Part. They wanted to specifically choose published blog posts that relate to the new blog post in Orchard. A list of possible published blog posts associated with the Blog Container is listed in the dropdown list. Clicking the Add Button results in an AJAX Call to the Orchard CMS Web Server to associate the related blog post as well as some nice jQuery animation that appends the blog post to the list. Since this is using jQuery Ajax, performance is very good and the user interface is very responsive.

Related Blog Posts Custom Orchard CMS Module

If you look closer at the Related Blog Posts Custom Content Part for Orchard CMS, you will notice that it has drag and drop grips that allow you to sort the order of the related blog posts. Some Orchard Blog Posts may be more important or related than others so simply dragging and dropping the related blog posts will execute a jQuery AJAX call that modifies the order in which the related blog posts are ordered. And as mentioned before, the Add and Remove Buttons are completely jQuery AJAX as well. Choosing to Add or Remove a related Orchard Blog Post will cause the Orchard CMS Server to be updated as well as the browser. Of course all of this works using proper security permissions and authentication tokens so there are no Orchard security related concerns.

Custom Orchard CMS Content Part for Blog Related Posts

Once you have finished choosing the related Orchard Blog Posts on the administrative side, you can of course display the related blog posts as you wish on the public Orchard Website Blog. You have complete access to all the information of each Orchard Related Blog Post and can display them appropriately at the end of the blog post or wherever you desire.

Again, this is the power and extensibility of Orchard CMS, which makes it a fantastic ASP.NET MVC CMS for your .NET Websites.

Conclusion

At some point I will probably add this custom Orchard module to my website as I have been wanting such functionality for marketing features. About 9 months ago I dedicated a lot of time to learning Orchard CMS Development and I am hoping to continue developing custom Orchard Modules and Orchard Themes full-time in 2012. If you are interested in hiring me for your next project, please contact me.

Contact Me