Injecting Resources into Experience Editor in Powerful Ways

I recently got a ping back from Eric Stafford on an old blog article of mine, the first one I had ever posted! He was working on some code and needed to inject in some custom CSS into the Experience Editor. We had several conversations on Slack, and I thought I’d post up some powerful ways in which to achieve this. Be sure to check out Eric’s posts, he’s done a fair amount of research into different ways of achieving this as well.

Javascript

Read More

Advertisements

Environment Styler for Sitecore

tl;dr; Install the module, set the config value to match your environment, have a stylised login screen and header bar per environment.

Have you ever sat there working on some task and then suddenly someone asks you to take a look at an issue on the Production environment? So you log onto that server, resolve the issue, get distracted for a few minutes by cat videos and then get back to what you were doing. But you suddenly realise that those changes you were just making was not on your local environment, you still had the Production site open in your browser tab! Oh noes!

Oh noes!

The problem is that all the environments all looks exactly the same… the only difference being that teeny tiny URL bar, the URL in which probably also looks very similar apart from some environment prefix.

Read More

Adding custom Javascript and Stylesheets in the Content Editor

tl;dr Add custom resources in the Sitecore Content Editor from config setting

I recently created some custom fields in which I needed to add some custom JavaScript. I looked at a couple of other implementations of custom fields but they all worked on the individual control, not at an Item level or adding snippets of Javascript by inlining it adding if from code-behind declarations. I also wanted to avoid modifying any standard Sitecore files if at all possible, which some of the other custom field implementation had done and makes installing multiple packages tricky since each would overwrite the changes of the others. Aside from which, I wanted to avoid it from an upgrade point of view. I also needed to update the UI when the content had been loaded so would need to listen for that event.

Read More