cms · enhancement

How to inject the custom icons to Sitecore 8

Someone wants to inject their own icons to Sitecore 8 so that they will be able to change the icon of Sitecore items later inside Sitecore. It’s something like this:

csi_1

The Reference

Modifying \sitecore\shell\Applications\Content Manager\Dialogs\Set Icon\Set Icon.xml which handles Change Icon dialog of Sitecore:

  • replace CodeBeside to the new class so that we can have a chance to add the custom icons and some missing icons of Sitecore such as ApplicationsV2, BusinessV2, FlagsV2, NetworkV2, PeopleV2, SoftwareV2 to Change Icon dialog
    • csi_3csi_4
  • add new multiple ListItem to “Selector” Combobox
  • add new multiple Scrollbox to “List” Border
    • csi_6.png

In the new class SetIconForm which is cloned from Sitecore.Shell.Applications.ContentManager.Dialogs.SetIcon.SetIconForm

  • add new multiple properties:
    • csi_7
  • update RenderIcons method by adding these lines below:
    • csi_8

Creating a zip file as Custom.zip whose the folder structure should be same as the default ones (Ex: \sitecore\shell\Themes\Standard\Apps.zip) and putting it into \sitecore\shell\Themes\Standard folder

  • csi_9

PLEASE DO NOT FORGET to deploy the new SetIconForm class to the Sitecore instance.

 

ARE YOU LAZY?

Yes, I am. That’s why I create a Sitecore package so that I can install it and play with the custom icons + the missing ones as well on any Sitecore instances:

  1. should backup sitecore\shell\Applications\Content Manager\Dialogs\Set Icon\Set Icon.xml
  2. download and install Vhs.CustomIconsInjector Sitecore package to your Sitecore instance via Installation Wizard
    • click Yes button when you see something like this
    • csi_10
  3. try to change the icon of a Sitecore item and hopefully you’re gonna see these ones
    • This slideshow requires JavaScript.

       

Not Good Enough? Please feel free to download the source code and add your own enhancements if necessary.

Got issues?

Please send your issues (with screenshots if possible) to viet.hoang.sitecore@gmail.com so that I have a chance to understand your problem and be able to suggest the solution.

Happy Sitecore Coding!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s