how to set favicon on my publish page?

kong 41 Reputation points
2021-07-29T10:10:08.863+00:00

Hello ,

I am using SP 2013 and have a publish site collection. i create a custom master page and then create a publish page from this master page.

However the favicon is always null :

119052-image.png

The left tab is my publish page and the right one is sharepoint page.

i tried following code in my master page:

<SharePoint:SPShortcutIcon runat="server" IconUrl="sitecollection/CN/Style%20Library/Image/favicon-16x16.png" />  

but it does not work. F12 network tab shows the icon has been download. but the browser tab icon still is blank.

Can you help me?

thanks

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
2,422 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,657 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
3,081 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MichaelHan-MSFT 18,126 Reputation points
    2021-07-30T02:37:00.403+00:00

    Hi @kong ,

    Looks like you miss a / character in the begining when using relative path of the image. It should be

    IconUrl="/sitecollection/CN/Style%20Library/Image/favicon-16x16.png"  
    

    Also you could try to use absolute path of the image:

     IconUrl="http://sp/sitecollection/CN/Style%20Library/Image/favicon-16x16.png"  
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.