Setting __Renderings field not shared in Sitecore consequences?

安稳与你 提交于 2019-12-03 14:53:01

My own preference when needing to swap around visual elements based on something like language, country of origin, etc. is to use Sitecore's personalization rules editing to swap data sources and alter the presentation in that manner. It doesn't involve changing Sitecore's default behaviour and allows you to tap into built-in Sitecore functionality.

If your different 'sublayouts' are actually just the datasources being pulled in by various personalization rules, you can configure all of this with OMS/DMS and rely on the Sitecore engine to present the components you need given the current state. For performance, going with the most recent version of DMS is probably best (I believe 6.5 Update 5 is now the recommended release).

Modifying Sitecore's default behavior in this way is usually not a good idea. It's not transparent for others people that might work with the system in the future and it could lead to unexpected results.

Imo, it's better to make a switch inside the (sub)layouts so it loads different files based on the current language.

As for the consequence. It will work as you expect when you make the _Renderings field unshared. You will be able to set different presentation details for each language version. The consequence is that you must now set it for each language version... so it will be less easy to manage.

I would instead use the the Devices of sitecore. For each language you can define a Site and each site can have their own Device. This will work out-of-the-box if you have one domain name forr each language (www.site.com, www.site.de, www.site.fr etc...)

If you have one site (one host name) for all languages, you can switch the devices with a httpRequestBegin pipeline processor.

This article, http://briancaos.wordpress.com/2012/04/12/identifying-mobile-devices-in-sitecore/, describes how to identify mobile devices. It is not hard to rewrite the logic to switch devices depending on the language.

When you have defined different devices for each language you simply place the renderings on the device matching your language. And you still have the possibility of a fallback device for all those pages where all renderings are the same.

Modifying the Sitecore default behaviour might work for now, but using and extending the Sitecore platform is a better way forward.

We have indeed done this, and for the most part there are few side effects. In fact, it's the only way you are going to get workflow on __Renderings changes. We combine it with Partial Language Fallback so that languages can inherit the value from English. However be careful, as if an item is cloned, it will always pull its default value from the clone first, rather than standard values / fallback.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!