My website is up again with a new facelift. Not only that, internally, it is now running on the brand new Orchard CMS system. At time of writing, Orchard is at version 1.2.4.1.
My original website was running on Asp.net WebForms. While not naturally a bad thing, it does take quite an effort to update/extend it. In other words, maintenance is a nightmare. MVC 3.0 is a welcome addition when it was introduced. I immediately sat down and tried to rewrite the whole site from scratch using MVC.
After a number of controllers and actions and writing endless CRUD functions, things started to get a bit tedious and boring. Then I found Orchard. Runs on MVC 3.0, takes care of all the boring back-end functionality, and I only need to add functionality specific to my needs and then Orchard stitches everything up together and run. Just what the doctor ordered. ![]()
Its all about Parts
The functionality of Orchard can be extended in various ways. One of them is through Parts, which is similar to a plugin/module. At the end of this website rewriting exercise, I ended up writing the following parts/modules to get all the functionalities I need on my website. I might share some of the challenges encountered while writing theses parts in later posts. Here’s the list :-
1. LotusImaging theme.
A dark minimalistic theme suited for photos/portfolio display. This theme also extends the main menu to include the icon (1) above the title (2) and a small caption (3) below it, with a little bit of jQuery animation script thrown in to spice things up.
2. Rahmat.Users.Profile Part
This part extends Orchard.Users module to allow users to specify a DisplayName (1) which will be shown instead of the basic username and also to support Facebook users connecting with their Facebook account. It also hooks into the Orchard.Comments to display the commenter’s DisplayName. The Facebook user’s fullname will be displayed, if the user logs in using their facebook account. It also depends on Contrib.Profile.
3. Rahmat.Avatar Part
A part responsible for displaying an avatar (1) on content items where ownership is valid, like a blog post, or comments. Currently supporting Gravatar and Facebook profile photo.
4. Rahmat.Facebook Part
A part to handle users logging in with their facebook account. It wraps around the Facebook C# sdk to provide communication with Facebook.
5. Rahmat.Facebook.Like Part
A simple attachable part to display Facebook Like social plug-in. The figure below shows the part in action when attached to the Blog Post content type.
6. Rahmat.Sitemap Part
A dynamic sitemap (breadcrumbs) part that is based on the Sitemap control that comes with Asp.net WebForms. Unlike the static sitemap control, this one is modified to work with the MVC routing system.
7. Rahmat.ViewCounter
A simple part that is attachable to any content item to track the number of times the content has been viewed (1).
8. Rahmat.Showcases Part
This one is a biggie. It took me the longest to write. This part is used in Portfolio and the Gallery section. It supports albums, photos, flipbooks, slideshows and allows visitors to submit comments to individual photos.
Conclusion
All in all, that is about 8 parts that I have to come up with, some simple and some not. With a lot of basic and the back-end functionality handled by the Orchard framework, it has made my life a lot easier. Still, developing for Orchard is not straight-forward and with a total lack of documentation in certain areas, I have to resort to reading the source codes to understand how the system works.
Guess that is time worth spending.
