Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gregg Duncan 48 posts 70 karma points
    Oct 21, 2010 @ 22:32
    Gregg Duncan
    0

    Multiple sites each with it's own favicon

    We are creating multiple sites on a single umbraco installation. Each site will be for a different client although they are all affiliated with the same company they are all independent companies of their own. Therefore they can share templates, document types and macros. But they need different media, sitemaps, . This would include using their own favicon.

    How does one go about setting up the favicons for a multiple site environment like this? Any help would be greatly appreciated.

    Gregg

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Oct 21, 2010 @ 22:49
    Chriztian Steinmeier
    1

    Hi Gregg,

    You put the favicon.ico file somewhere specific for each site, and then use a link tag in the header to point the browser to its whereabouts, e.g.:

    <link rel="shortcut icon" href="/path/to/favicon.ico">

    /Chriztian

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Oct 21, 2010 @ 22:54
    Jan Skovgaard
    0

    Hi Gregg

    If the sites are sharing the same master-template I guess you could place an upload field on your document type for the homepage for instance, where you can upload the favicon to and then fetch it using either a XSLT macro or by using umbraco:item. I would probably go for the umbraco:item on this one, since I think a string is returned when using the upload property...

    /Jan

  • Gregg Duncan 48 posts 70 karma points
    Oct 22, 2010 @ 00:37
    Gregg Duncan
    0

    Hi Jan,

    Thank you for the suggestion I think that's the best way to handle it. For others that might need to know how to do it this worked great for me. I added the umbraco:Item field with the tag being written in the insertTextBefore and insertTextAfter fields like below. Now I can upload the favicon for each site and the MasterPage template takes care of the rest.

    <umbraco:Item field="favicon" insertTextBefore="&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/x-icon&quot; href=&quot;" insertTextAfter="&quot; /&gt;" recursive="true" runat="server"></umbraco:Item>

    Good Stuff!

    Thanks Jan. Hi 5!

  • Gregg Duncan 48 posts 70 karma points
    Oct 22, 2010 @ 00:46
    Gregg Duncan
    0

    Darn it! I'm sorry Jan, I meant to click your post as the accepted solution to this issue. I clicked the wrong one and I don't see any way to change it.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Oct 22, 2010 @ 08:08
    Jan Skovgaard
    0

    Hi Gregg

    Glad it worked for you - nevermind the solution thing. As long as your problem is solved I'm allright with that :-)

    /Jan

  • Ben Edwards 11 posts 32 karma points
    Nov 10, 2010 @ 09:14
    Ben Edwards
    0

    The only problem with this solution is that your IIS logs are going to fill up with 404 request for /favicon.ico due to the fact that there isn't one at the root. So I'm going to work on a solution that returns a different favicon for each site that is root relative

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 10, 2010 @ 10:13
    Jan Skovgaard
    0

    Hi Ben

    You could probably place all the different favicon's in the root of your site and then make a dropdown property on your node where you can choose the favicon...

    So you populate the fields with the exaxt names of those favicon's placed in the root like favicon1.ico, favicon2.ico etc.

    and then you just need to use either umbraco:item or a macro to fetch the value.

    Hope that it makes sense.

    /Jan

  • AstonHaigh 1 post 21 karma points
    Aug 30, 2013 @ 11:58
    AstonHaigh
    0

    Couple of years too late but what about IE? IE 9 & 8 dont display favicons in sub directories. Was a work around for this found?

  • Gregg Duncan 48 posts 70 karma points
    Aug 30, 2013 @ 18:53
    Gregg Duncan
    0

    Aston,

    I don't have that problem with Umbraco. However, we also use Sitefinity for some other sites and I ran into that issue there. Make sure you're using rel="shortcut icon" instead of just rel="icon". And, try putting a question mark (?) at the end of your favicon url. I won't pretend to know why this works and I don't remember where I found it (Somewhere on StackOverflow I'm sure). But it worked for me. 

    The tag should wind up looking like this:

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

    If you're using the Umbraco:Item to out put the favicon tag it would look like this:

    <umbraco:Itemfield="favicon"insertTextBefore="&lt;link rel=&quot;shortcut icon&quot; type=&quot;image/x-icon&quot; href=&quot;"insertTextAfter="&quot; /&gt;?"recursive="true"runat="server"></umbraco:Item>

    I hope this helps.

Please Sign in or register to post replies

Write your reply to:

Draft