Contents
When do you need to use rendering parameters?
Rendering Parameter is a way to pass the additional item (s) to the rendering or component apart from rendering data source. W hen to use Rendering Parameters? Let’s assume, you are in a situation where content editors need to use some additional items on a component apart from its actual data source.
When to use the variable name sent to the render function?
The variable name you sent to the render function is only available while rendering the page, after it is sent to the client, it is not accessible. You have to use it in your view on the rendering stage. Since you are using handlebars, you can display it in your page like this, for instance:
Where do I find the rendering parameters in Sitecore?
Once you reference your parameter template to your rendering, you can then check the same by going to the content item where you are using this rendering and go to the Presentation > Details > Final Layout and select your rendering and click edit – you should see your Rendering Parameter field there. See the image below
Can you still use rendering parameters in MVC controller?
You can still use the rendering parameters in the same way we use for MVC controller renderings. The Only task which is going to be a bit different is – reading the parameter value in code. So nothing to worry, here is the code to read the rendering parameter value from .ascx.cs file.
Where do I reference my rendering template Template?
Reference you parameter template on your required rendering under the Editor Options section of your rendering, as shown below
What are the parameters to render a template in Python?
Parameters: template_name_or_list – the name of the template to be rendered, or an iterable with template names the first one existing will be rendered context – the variables that should be available in the context of the template.
Which is better rendering parameters or DataSource templates?
The big reason though why I would always choose Datasource Templates over Rendering Parameters is because it’s much harder to modify rendering parameters programatically than datasource items.