For umbraco versions: umbraco3.0

MIsc
In this book I'll occasionally add a new chapter explaining a new feature/enhancement inside v3 of umbraco.

Chapters

Enhancement: More beautiful alternative templates

Do you know about the altTemplate functionality in umbraco? Basically it's an easy programmatically way to specify rendering a page in another way than the default. This is very useful for things like:

  • Alternative formats, like rss view, xml for Flash or export as pdf
  • Alternative views: Like printable (sometimes just using css is not enough)
  • Alternative functionality: Like Send-to-colleague or create an item below the currentpage

In v2.x an alternative template was specified by adding "altTempalte=[alias-of-template] as a querystring variable. So displaying a news page with a url like this "http://mydomain.org/news/v3-is-released.aspx" as RSS would make the url look like this: "http://mydomain.org/news/v3-is-released.aspx?altTemplate=rss".

The functionality was neat but also a bit ugly, so in v3 I changed the syntax to just appending the alias of the tempalte to the url. While not a big enhancement it shows how every single detail in umbraco is twisted and turned to perfection - in v3 the above url would look like this:

"http://mydomain.org/news/v3-is-released/rss.aspx"

Much prettier, right =) 

(of course the old altTemplate still works...)


Brilliant umbraco hosting provided by FAB-IT