Sunday, 21 August 2016

Sitecore Attributes Patching




If you are working with sitecore since a while then of course you had the experience and the need of writing some custom processors and inject any of the existing Sitecore pipelines; and if you had enough experience you will definitely know that the best practice is to use a separated configuration file for this custom configuration and place it in the include folder.




Yes sitecore provide us with the ability to create module, feature or instance specific configuration using the include folder configuration files, you can define what ever configuration you need and place it within file in the include folder and sitecore while processing the web.config will include these files, an important thing you need to know is thin will happen in aliphatic order, which mean configuration files will be merged from A until Z, with the configuration the appears at the end will override other configurations. 

Following is an example of how you can patch a simple processor,



 


So do you ever needed to change an attribute of configuration element within sitecore configuration? I needed this once will show you how you can patch any attribute within sitecore configuration elements in you web.config.

See the following examples of patching attributes,

The following example is setting the Link manager language embedding attribute to never,
Following example will set the default database for my default website to master:
Hope the above will help!

No comments:

Post a Comment