Wednesday, September 30, 2009

Using Parameter Templates in renderings

This is my first serious attempt at writing something helpfull, so I hope it will be well recieved ;)
A new feature introduced in Sitecore makes it possible to create a data template and use the fields of this template as predefined parameter names for rendering! Personally I like this very much. But how does it work?

For example consider a rendering for a top 5 songs list. That song list can be added on different pages through the page designer by the editors, but they want to be able to choose the genre of the songs that should be shown (rock, pop, country etc.).

Before this we could only add custom parameters to renderings where they were used by both typing parameter name and value, which is not very userfriendly (The editor would have to remember both Parameter name and the allowed values):



When Using Parameter templates the above properties window looks like this instead:



In the above example I have used a Parameter template with three fields, a text field, a checkbox field and a multilist field to show different types of fields can be used.

So How do we make this happen. Very easy:
Create a normal template

Make sure that the template inhirits from the standard template and the System/Layout/Rendering Parameters/Standard Rendering Parameters template. That's what makes the magic happen!

Create the rendering where the Parameter template is needed

Click on the rendering definition item and find the field called "parameters Template" and choose the template.



And voila, it all works!!

Comments about usefullness etc. is very welcome!

Tuesday, September 29, 2009

Yet another Sitecore Blog

This is my first attempt at blogging so be gentle!

This blog will mostly be about Sitecore. Not the hardcore technical stuff, but new functions/features and tips and tricks (if I can find any that hasn't been blogged already).

I am working for Sitecore so my blogging will be biased! Now you are warned ;)