It takes me 2 whole days to solve this issues. I created a experience site with LWC component and want to set favicon.
I set the Favorite Icon in the force.com setting and set head markup according to the following page.
https://help.salesforce.com/s/articleView?id=000383315&type=1
<link rel="shortcut icon" href="<SITE>/favicon.ico?v=2" />
It says
The <SITE>
would be the URL of the site. For example, whatever the URL value at Setup | Digital Experience | All Sites says.
This part is wrongly described. If we set the as described, it will be like below:
https://mydomain--dev.sandbox.my.site.com/sitename
But if finally figured out that, the <Site>
part only work if use url in the Force.com in format like
https://mydomain--dev.sandbox.my.site.com/[sitename]vforcesite
<link rel="shortcut icon" ...
only worked across all browsers when put in the<head>...</head>
part of the page.<head></head>
inside of the<apex:page>
. Does the file type matter? I am using a .ICO which is what I use on our corporate site, not sure what is wrong honestly. Looking at the code on the rendered page the<link />
is not between the<head>
tags. How can I force items between the<head>
?type
parameter set.) In my pages I have the head section explicitly defined and all the standard Salesforce output turned off usingshowHeader="false" sidebar="false" standardStylesheets="false" applyHtmlTag="false"
. That gives me just the head section I want.