Contents tagged with Module
Advanced Sitemap is currently the only module to provide extensions points for developers who are doing a lot of custom development on their site. The basic use case of a module like this is very straightforward: take all of the content items and list out all of their urls in some sensible way. But what if you have routes that don't necessarily align with urls set in your content items? Entering custom routes in the admin can suffice if there aren't too many, but if you use a lot of custom routing in your MVC controllers, it would be nice to have these urls reflected accurately in the sitemap.
In this series we will be implementing a custom module to see what it takes to implement a Templated Messaging System that leverages not only basic Orchard stuff, but also more advanced APIs such as Rules, Tokens, Messaging, Channels, Site settings and Content Type/Part settings.
This module will enable our users to do the following:
- Create and manage Messaging Templates (which will typically be used for email messages) using parser engine specific syntax (which will be Razor by default);
- Setup Rules that sends a templated message when one or more events occur;
- Use Tokens in the Subject field as well in a field that is part of the SendTemplatedMessage action;
- Configure which parser engine to use by default using site scope settings and content type scope settings.
At the end of this tutorial we will not only have a useful module, we will have learned how we can wire things together with the Rules and Tokens modules and have a better understanding of how they work and can be leveraged in other modules.
In this first part, we will start simple by creating the module and implementing a basic Template Management System. We will:
- Define a MessageTemplatePart that stores information about a template, such as the template text itself;
- Define an EmailTemplate content type that uses the MessageTemplatePart;
- Implement an IMessageTemplateService that helps with quering templates.
- Learn how to implement import/export for custom parts that reference other content items using the ImportContentContext.GetItemFromSession method.
Sébastien's very handy cheat sheet for orchard module and theme developers and designers has been updated. It's an invaluable resource for all of us.
This quick tip will show how you can write a custom view for a custom controller action in Orchard that does not use the current theme, but that still retains the ability to use shapes, as well as zones, Script and Style helpers.
Module development how-to, localization and QnA
Microsoft recently released WebMatrix 2 RC which has numerous new features including code completion / intellisense. As an Orchard CMS Developer, I am excited about intellisense in WebMatrix to help with creating Orchard Themes and Modules. Although the release candidate does offer some code completion to make it easier to develop custom Orchard Themes and Modules in WebMatrix, the development experience is rather spotty at the moment.
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.