Question

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

Was it helpful?

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.

OTHER TIPS

The Sitecore desktop/content editor and page editor rely on Sheer UI for their rendering format. If you look at Sitecore.Web.UI.HtmlControls you will see the various "types" that can be rendered through files such as <Sitecore file path>\Website\sitecore\shell\Applications\Shell.xml.

Currently I don't see anything to output a shortcut icon into any content editor page.

Even if you could, you likely would not want to do this as any upgrades to Sitecore will eliminate your changes for the shortcut.

In page editor you can set the icon in the same way as for the page:

<link rel="shortcut icon" href="...">

Add above to your layout aspx file's head tag.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top