Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

How to disable favicon for particular country site in aem?

Avatar

Level 2

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?

1 Accepted Solution

Avatar

Correct answer by
Level 6

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

 

View solution in original post

4 Replies

Avatar

Correct answer by
Level 6

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

 

Avatar

Level 4

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"/>

Avatar

Level 2

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

 

Avatar

Level 6

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

MukeshYadav__0-1721225986354.png

You may have a look below thread as well

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

 

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

 

MukeshYadav__0-1721226435374.png

 

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

MukeshYadav__0-1721227603869.png

 

Thanks