Search code examples
sitecorefavicon

How to change sitecore shell favicon?


When I login into sitecore dektop or content editor or page editor there is default sitecore favicon. Is it possible to change this icon?


Solution

  • I created custom SheerUI control, and registered it in Web.config.

    [ParseChildren(false)]
    public class Favicon : Component
    {
        public Favicon()
        {
            this.RenderAs = global::Sitecore.Web.UI.RenderAs.Literal;
        }
    
        protected override void DoRender(HtmlTextWriter output)
        {
            global::Sitecore.Context.ClientPage.Page.Header.Controls.Add(
                new Literal { Text = "<link rel=\"icon\" href=\"/faviconn.ico\" type=\"image/x-icon\" /><link rel=\"shortcut icon\" href=\"/faviconn.ico\" type=\"image/x-icon\" />" });
        }
    }
    

    Then I added tag:

    <Favicon />
    

    to \Website\sitecore\shell\Applications\Shell.xml.

    I also added this two lines to /sitecore/login/default.aspx

    <link rel="icon" href="/faviconn.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="/faviconn.ico" type="image/x-icon" />
    

    I know this will not survive update, but It's good enough.