Automate Adding Experience Editor Buttons to Renderings with SPE

I had an situation last week where I needed to add a experience editor button to all components and we have 63 of them. So Instead of doing this manually I decided to see if I can do this easily with SPE.

The other thing I had to consider is that most renderings had some custom experience editor buttons already, so I needed to make sure these were maintained.

exp-editor-button

Also I only wanted to add the button if there was a datasource set as it is only relevent to components with buttons.

It turns out this wasn’t that tricky and this same script could be used to populate any multi-list field, such as auto-setting the compatible renderings:

add-exp-editor-button-spe

Show Me The Script Already

Hopefully someone else will find this useful too.

Published by

Adam Seabridge

I am a Freelance Sitecore Developer and 7x Sitecore Technology MVP (2024 - 2018). I have been working with Sitecore since 2013. You can reach me on twitter @billyjava or comment below if you have any questions or feedback.

Leave a Reply

Your email address will not be published. Required fields are marked *