How to disable favicon for particular country site in aem? | Community
Skip to main content
Level 2
July 15, 2024
Solved

How to disable favicon for particular country site in aem?

  • July 15, 2024
  • 4 replies
  • 1123 views

hello,

I have two countries us/en and in/en. The favicon is visible for us/en but not visible for in/en so I just want to know how we can do this enable and disable thing?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by somen-sarkar

Hi @prachimathur ,

The favicon icon is typically loaded in the <head> section of a website. Usually, this involves an HTML snippet with a link element like:

<link rel="icon" type="image/x-icon" href="/path/to/your/favicon.ico">

To understand the actual loading process for your site, examine the head.html and associated HTML files. For US the favicon icon may be loaded as it is able to find the asset but not for IN . You can customize the script for your site to  enable/disable the same.

 

Thanks,

Somen

 

4 replies

somen-sarkar
Community Advisor
somen-sarkarCommunity AdvisorAccepted solution
Community Advisor
July 15, 2024

Hi @prachimathur ,

The favicon icon is typically loaded in the <head> section of a website. Usually, this involves an HTML snippet with a link element like:

<link rel="icon" type="image/x-icon" href="/path/to/your/favicon.ico">

To understand the actual loading process for your site, examine the head.html and associated HTML files. For US the favicon icon may be loaded as it is able to find the asset but not for IN . You can customize the script for your site to  enable/disable the same.

 

Thanks,

Somen

 

Shivam153
Level 3
July 15, 2024

Hi @prachimathur ,

You can put a sightly condition during providing href parameter. You can take currentPage.path and compare if you want certain country to be part of it.

example: 

<link data-sly-test.iconName="${'/content/we-retail/en' in currentPage.path ? 'en.ico' : 'other.ico'}" rel="icon" href="/content/dam/anyPath/${iconName}" type="image/x-icon"/>

Level 2
July 17, 2024

Hi all, Is there any way to author favicon without making any code changes?

 

MukeshYadav_
Community Advisor
Community Advisor
July 17, 2024

Hi @prachimathur ,

fav icon display from template page

In general we override the core page component in our project, add/made changes in required files.

In AEM 6.5 based on version used it is present in head.resources.html

You may override this head.resources.html

You may have a look below thread as well

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/favicon-aem-6-5/td-p/548185

 

If you are using AEM cloud then you may find /libs/core/wcm/components/page/v2/page/head.resources.html

 

 

It is very easy to override just copy paste that file in your project page component, there might be already few files like body.html,customfooterlibs.html, etc

 

Thanks