Questions Ask questions on Kentico CMS 4.0 BETA or RC. This forum is closed.
Version 4.0 BETA and RC > Questions > How do we post custimized .ico (favicons) for our site(s) View modes: 
User avatar
Member
Member
pstokstad-global-id-group - 1/15/2009 10:05:11 AM
   
How do we post custimized .ico (favicons) for our site(s)
I note this post on how to do multiple favicons, but how do we do one for one site and override the kentico default image?

http://devnet.kentico.com/Knowledge-Base/API-and-Internals/Using-different-favicon-images-for-multiple-web-si.aspx

User avatar
Member
Member
ben-federationmedia.co - 1/15/2009 4:39:52 PM
   
RE:How do we post custimized .ico (favicons) for our site(s)
just replace the favicon.ico in root folder with your own

User avatar
Member
Member
mcutter-global-id-group - 1/16/2009 11:29:03 AM
   
RE:How do we post custimized .ico (favicons) for our site(s)
Here's a better approach.
All you have to do is name your icons "favicon_<sitename>.ico" and place them at the root of the kentico site.
Then replace the FavIconTag method as follows

app_code/cmspages/documentbase.cs: line 375
public string FavIconTag
{
get
{
if (mFavIconTag == null)
{
mFavIconTag = "";
string favIcon = "favicon" + CMSContext.CurrentSite.CodeNameColumn + ".ico";
if (File.Exists(HttpContext.Current.Server.MapPath("~/"+favIcon)))
mFavIconTag = "<link rel=\"shortcut icon\" href=\"" + ResolveUrl("~/"+favIcon) + "\" />";
else if (File.Exists(HttpContext.Current.Server.MapPath("~/favicon.ico")))
mFavIconTag = "<link rel=\"shortcut icon\" href=\"" + ResolveUrl("~/favicon.ico") + "\" />";
}

return mFavIconTag;
}
}

User avatar
Member
Member
Darren - 1/19/2009 8:18:15 AM
   
RE:How do we post custimized .ico (favicons) for our site(s)
I've seen this method mentioned a few times now, it strikes me as a bit long winded. Is there any reason why you can't just put <link rel="shortcut icon" href="path to .ico" type="image/x-icon" /> in the head of each site?

User avatar
Member
Member
Jon Hopper - 2/2/2009 9:32:26 PM
   
RE:How do we post custimized .ico (favicons) for our site(s)
I can't find the file
<your project folder>\App_Code\CMSPages\DocumentBase.cs file in v4.0 RC

I can find it within the MetaData of the CMS.UIControls.DocumentBase though

Is there any other way of achieving this?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 2/3/2009 4:55:33 AM
   
RE:How do we post custimized .ico (favicons) for our site(s)
Hi,

As you can see, this KB article is for version 3.x - http://devnet.kentico.com/Knowledge-Base/API-and-Internals/Using-different-favicon-images-for-multiple-web-si.aspx.

In the 4.0 version was the document base moved to an assembly. Anyway, the methods there are virtual so you can inherit this class and override the methods.

Best Regards,
Juraj Ondrus