4

I have a component rendering, which is added to the shared layout of the standard value of a page template. This page template has multiple language versions to have different values per language.

Is there a way in Sitecore to make the rendering, which is on the standard values, have different rendering parameter defaults per language? Right now if I add one value to the shared layout it reflects across all languages.

1
  • I see you already have some solutions, but more curious than anything else, but do you have an example of a business requirement that would have different rendering parameters based on language? Jun 15, 2018 at 14:41

3 Answers 3

1

I'm not sure if you can do that using the shared layouts. I know you can do that using the final layout. In order for you to do that using the final layout you need essentially two things:

  1. Have a version on the standard values for each language you need
  2. Set the rendering parameters on the Final Layout and not on the shared one.

You can make a test and using the standard values for each language set different values for a field using the final layout and you will see it in action.

1
  • I'll give it a try tomorrow and get back. Thanks!
    – Gabbar
    Feb 28, 2017 at 2:44
2

The actual value of the rendering parameter(s) is stored inside the layout field(s). So if you add a rendering with parameters in the shared layout, it is stored in a shared field - meaning you cannot make them different per language.

So what you really want is not possible, but you have a few options:

  • put the rendering on the final layout as Diego suggested (easiest setup, but you will need to add the rendering for each language)
  • create multiple rendering parameters (preferable using a renderings parameter template), so you have one value per language - it's a theoretical option, I would never do this
  • use a link to another item as rendering parameter - making it more like an extra datasource. The item you point to can be translated in all languages and contain all fields you desire. By using a rendering parameters template you can have a link-type field to make the selection of the item easier.
1
  • These are some great options! But for the task at hand, Diego's answer should suffice.
    – Gabbar
    Feb 28, 2017 at 14:22
1

I tried all possible options for rendering parameter supporting multilingual ability and found two achievable solutions below:

  1. (Which I would not prefer) Datasource way, instead of rendering parameter use Datasource (which has rendering parameter field in it).

  2. (I prefer)

    1. Create rendering template for the component
    2. Bind rendering template to the rendering component
    3. Create page specific template
    4. Create its standard value (no need to create language specific version at standard value level)
    5. Very important, add rendering component in "Shared layout" section not Final layout
    6. Create a page from the created template
    7. Update rendering parameters only in Final Layout
    8. In case of multilingual create another version of the item and set only rendering parameter values.

If you add rendering in final layout, in that case when you add new item version you will lose rendering as well as its values. Whereas in this solution, the user does not have to create a new version at standard value level, they have to create a version at the item level and then just have to update rendering parameters in the final layout.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.