Better theming for your DotNest site with improved Liquid templates

As you surely know there are a variety of options to theme your DotNest site, including going hardcore and writing templates with Liquid markup. Now if you're among those hardcore developers who want to write code even for their DotNest sites, good news: Liquid just good a lot smarter!

The Liquid Markup module is available on all DotNest sites and it enables you to create templates either from the admin or deploying them from source control (see who this works on the Writing a theme from scratch Knowledge Base article). In these template you can use the Liquid Markup language, which is a bit more restrictive than e.g. Razor what you may usually work with when developing Orchard. However still it's quite powerful and now we have the following new features:

  • Variables, not just fixed strings can be used when passing parameters to tags. So e.g. you can create a custom dynamic title for your pages.
  • Accessing items of collections in the view model are now supported. E.g. from a template now you can selectively display the second and third image attached to a content item, not just the first one as before.
  • The antiforgery token can now be displayed so you can write completely custom forms.
  • Orchard-aware relative links can be easily constructed, so you can construct dynamic URLs that will work in any environment.
  • Custom link and meta tags can be registered. This way e.g. you can add multiple shortcut icons for your site or add custom meta tags for Facebook sharing.
  • Custom CSS classes can be added to shapes to improve how you can style those elements. Furthermore CSS classes can now also be added to the HTML document.

For the whole list of features and examples covering every scenario take a look at the module's Readme. So brush up your Liquid skills and start coding!

No Comments

Add a Comment