cancel
Showing results for 
Search instead for 
Did you mean: 

How to change favicon for Portal Service Website?

former_member221786
Active Participant
0 Kudos

Hello,

I have the requirement to customize favicon for my Portal Service Website. Unfortunately I was not able to achieve that as of right now.

Can anyone give me a hint what I have to do to get this done?

For my applications it works fine when i set favicon in the manifest file. I would have expected something quite simlar for Portal Websites.

Any help is appreciated. Thanks in advance!

Kind regards,
Sebastian

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member188487
Active Participant

Hi Sebastian,

This is documented in the Cloud Portal FAQ page at https://help.sap.com/viewer/3ca6847da92847d79b27753d690ac5d5/Cloud/en-US/4b8ccb35548f4dc5bef0c80a5a5...

Q: How can I change the favicon and the browser tab title for SAP Fiori launchpad?

A: To change the favicon and browser tab title, use the following jQuery commands and launch them from a shell plug-in: jQuery('head title').text("New title for the tab"); jQuery.sap.setIcons({favicon: "http://materialdesignblog.com/wp-content/uploads/2015/04/387b93c8b66379c32e1cc2b98dcf5197.png"}); //this is the standard SAPUI5 way to change the favicon

Thanks and regards,

Lorraine

gregorw
Active Contributor
0 Kudos

Dear Lorraine,

thank you for this tip. Exactly what I just need in a project. I've added the code to a shell plug-in that I already had. And it works fine when the portal is launched. But as soon as I navigate in an app and click the Home icon the Favicon and Title text are set to the default. Do you have the additional tip to which event I have to register to get it in permanently?

Best regards
Gregor

gregorw
Active Contributor
0 Kudos

In the meantime I've found the great post Tracking SAP Cloud Portal Sites Usage Data with Google Analytics which provides the subscribeOnAppNavigation event. Unfortunately this isn't triggered when the #Shell-home is called.

0 Kudos

Hello,

i've encountered the same problem as Sebastian. When navigating to a Site (with Template "Freestyle Site") the default SAP icon is shown before it is overwritten by my custom icon.

Is there no other way to fix this problem?

Additionally the link to the Cloud Portal FAQ page at https://help.sap.com/viewer/3ca6847da92847d79b27753d690ac5d5/Cloud/en-US/4b8ccb35548f4dc5bef0c80a5a5... is broken.

Regards

former_member221786
Active Participant
0 Kudos

Dear Lorraine,

thanks for your response.

I've got it go somehow but my solution doesn't satisfy me completely.

As Gregor pointed out there is problem when selecting the Home-Button in FLP because the subscribeOnAppNavigation isn't triggered.
Also navigating to a Site (with Template "Freestyle Site") has a strange effect because for a short period of time the default SAP icon is shown before it is overwritten by my custom icon.

Do you have more hints to get a proper behaviour for setting a custom favicon in the Portal Service Context?
Maybe there is another event which is triggered when navigating between apps and sites? I also tried the registerNavigationFilter of ShellNavigation Service but unfortunately it is called before the favicon is set to default.

My Shell Plugin looks like this:

...
init: function() {
	// call the base component's init function
	UIComponent.prototype.init.apply(this, arguments);
        this._setFavIcon();
	sap.ushell.Container.getService("SiteService").subscribeOnAppNavigation(this._setFavIcon);
},
		
_setFavIcon: function() {
	var sPath = $.sap.getModulePath("shell/favicon", "/img/customFavicon.ico");
	jQuery.sap.setIcons({
		favicon: sPath
	});
}
...


I also had to manipulate the AppEditor in Portal Service to be able to select the proper App Type "Shell Plugin" (ComboBox wasn't enabled)
This souldn't be the common way for creating Shell Plugins, right?

Looking forward hearing from you!

Kind regards,
Sebastian Kielhorn