Recent Posts and Articles
In this part, we will be implementing the following:
- Two IParserEngine classes: SimpleTextParserEngine and RazorParserEngine;
- Site scope settings to configure which parser to use by default;
- Content type/part settings to allow the user to override the site level settings abd configure which parser to use on a per content type level basis;
- Improve the template editing experience with CodeMirror.
This is maybe the first question everybody starting with Orchard development asks. I.e. what should I do to have a Visual Studio solution that I can run and play with and use to start writing an Orchard module or theme? Here are the first steps.
When working in a team you naturally need source control but it's strongly advised even if you develop individually. So how to do this when working with Orchard? There are a few good options.
There is a new Shape Link in Orchard for adding custom shapes in Orchard Menus and Navigation. This will be released as a part of Orchard CMS 1.7, but I thought I would add it to my Orchard Tutorials now so Orchard Web Developers can prepare for it. This is all possible thanks to the pluggable navigation released in Orchard 1.5. I talked about the pluggable navigation some time ago in Dynamically Injecting Menu Items in Orchard CMS and Orchard Menus and Navigation for Online Store and E-Commerce Website.
Sometimes, when for example you're writing a Widget, you come across the need to know what the "current" content item being displayed is.
By "current", I mean the content item being routed to via the url. For example, if the url is http://mysite.com/about- us, a content item with the display alias "about-us" will be rendered.
In this post we will see how we can find out what content item is being rendered based on the current url.
Due to a bad recording setting, audio was not captured this week. We apologize for the inconvenience. We are still providing the link to the video, in case you want to check out the silent demos, but we won't embed it this week.
- Should have a doc topic on the query API. Sébastien also wants to revisit the HQL API.
- Sipke: showed part descriptions. This will go into core once Sipke has made some small adjustments such as moving description under part title in add part screen.
- Ylan suggested a hint setting to complement that, that would appear in the item editor. Could be tried as a module first, but would be better implemented once admin shapes are implemented and integrated.
- Sipke showed changes to content type editor: content types promoted to top-level admin menu item, added tabs for stereotypes. The content parts menu item should become a tab under content types. Stereotypes should not be tabs. We will list the stereotype next to the type name, and add a filter drop-down. Content types will be removed from the Content admin screen. Will show next week.
- Sipke will also remove the redirect to the list of types on content type save.
- Sébastien: transaction manager replaced by nHibernate transactions, with autoflush on. This a very impactful change, so please try this at home, and file bugs.
- Theming comments improved and made considerably easier.
- Demo: C# scripting, and script validation. This enables the administrator to write custom server-side validation code. Using Mono. Very similar to what Zoltán and Benedek built a while ago. Need to add restriction to site owner.
- Demo: Media Processing is in core now. It's been refactored since last time, and uses ImageResizer by default instead of GDI.
- Demo: multiple search index support. Benedek suggests having the configuration of which types get indexed in the Indexes admin screen rather than on each type's editor.
- Demo: Recipes tab under Modules enables execution of recipes at any time. Site owner required to execute recipes of course.
- Ylan announced http://orchardharvest.org for Harvest in May in Amsterdam. There is a poll, a stay informed form, and a talk submission form.
- Triage: 117 proposed before triage, 96 after. 121 active for 1.7.
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.