You can simply have any Sitecore field rendered within the Control Properties dialog just like in Content Editor.
And you can then access it as an ordinary parameter within rendering, for example within XSL Rendering:
<xsl:param name="type"/> <xsl:param name="username"/>
The idea is simple and beautiful. You create a template where you add those fields, then you assign that template to a rendering via the “Parameters Template” field:
While this is all great, I discovered today is two things today.
First, when assigning a Rendering Parameter Template to a Rendering, make sure that template is inherited from the following template, otherwise it would not work, and you will get an error. /sitecore/templates/System/Layout/Rendering Parameters/Standard Rendering Parameters
Second thing I’ve learnt about this feature is that the parameters that are being passed to your Rendering are case sensitive. In other words, if the field names on the template are “Type” and “Username”, you will need to specify your parameters accordingly:
<xsl:param name="Type"/> <xsl:param name="Username"/>
Things may be different for sublayouts and web controls, but you tell me :-)
Read more about rendering parameters here.
5 comments:
They're cool but it would be nice if they were taken a step further: they don't support localization (because the layout field is shared), and the interface to edit them is still a bit buried to the average CMS user.
That said, they have the potential to make the Page Designer so much more than it is - to let CMS users attach arbitrary bits of both presentation and content to a page in a single shot.
It'd be nice if that exception from inheriting from the wrong template was more informative too - that one got me the first time I tried to use them :)
Hi Alex, i hear that you had a nice presentation about Sitecore Search at Dreamcore . Do you have a public paper? Best regards, Vlad.
@Kamsar,
I believe you that layout field is shared, but do you have official Sitecore documentation to backup this information?
I know it is an old post, but I need to ask anyway.
Thanks.
Hey Alex,
Any idea how to access Rendering Parameter Fields of a sublayout from a nested xslt rendering? I'm rendering the transformation using the control directly in the sublayout.
- Josh
Hi Alex,
Any idea how to access Rendering Parameter Fields of a sublayout from a nested xslt rendering? I'm rendering the transformation using the control.
- Josh
Post a Comment