Recent Posts and Articles
After delving deeply into all parts of Orchard, still one area almost completely eluded me: Clay. I finally took the plunge and decided to figure out exactly how it all works. There's some information scattered around but I found very little documentation or explanation about how Clay behaviours can be written, only information on ways you could use existing Clay objects.
Elements of this journey were eerily reminiscent of Lewis Carroll's legendary narrative but be warned; herein lies nothing so mundane as smoking caterpillars or hungry walruses, and there's certainly no white rabbit with bad timekeeping to follow.
Rendering the ShoppingCart and ShoppingCartWidget.
In this part, we will:
- Create a display for the shoppingcart
- Enable our users to update the quantity and remove items from the shopping cart
- Create a widget that will be visible on every page and shows a link to the shopping cart page, as well as the total number of items in the shopping cart
- Show how to include resources with our module using the IResourceManifestProvider;
- Apply the MVVM pattern using KnockoutJS and jQuery on the client side to enable our users to update the quantities of the shoppingcart items, as well as update the shoppingcart "widget" in realtime
Creating the ShoppingCart service and controller.
In this part, we will enable our users to add products to their shopping cart.
In order for site visitors to be able to add products to their shoppingcart, we need a product catalog.
A product catalog could be as simple as a list of products. However, in this tutorial we want theme authors to be able to take over the rendering of the catalog and for example group the products by some sort of Category taxonomy.
Defining the ProductPart.
Content Items in Orchard consist of Content Parts. Using our Webshop module, we want the site administrator to be able to turn everything into a Product by simply attaching a ProductPart to any ContentType. For example, the user could define a Book content type, and attach the ProductPart to it, effectively turning the book into a product, which can then be added to a shoppingcart and linked to an Order and its OrderDetails.
Creating the Orchard.Webshop Module Project.
A module in Orchard is really just an ASP.NET MVC Area class library that follows both ASP.NET MVC as Orchard specific conventions.
The Orchard conventions power up your ASP.NET MVC Area so that it can integrate with Orchard.
Setting up your Orchard Development Environment (ODE)
When building modules for Orchard, it is recommended to download the complete source.
In this blog post series we will walk through the process of building an Orchard module from scratch!
While Orchard is an awesome CMS with powerful features and inspiring architecture that allows for unlimited extensibility, it might take some time to fully understand it's architecture and being able to customize all aspects of your own Theme or even create entire modules that integrate with all the extensibility points of Orchard.
It is my hope that you will benefit from the knowledge I gained along the way and that you will come to see the beauty of Orchard and its architecture. Not only is it just great for simple or advanced websites and blogs, but it's very much a base platform for building all kinds of webbased applications such as e-commerce backends, CRM's, supportticket systems, project management, community sites, learning management systems and so forth. Basically anything you would do from scratch should be considered being built using Orchard. Orchard is actually more of an extensibility framework than it is "just" a CMS. You plugin your own modules that can do anything which a regular ASP.NET MVC application also can, with the added benefit that Orchard has a rich set of features and composibility concepts of which you can take advantage.
The primary audience of this post are ASP.NET MVC developers who are just getting started with Orchard.