on 2006 Aug 18 5:29 AM
Hi,
I want to put a favicon in the portal. I have put the favicon.ico in the root of the webserver i.e. <SID>\JC01\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root
Modified the HeaderiView.jsp in masthead.par to add the following line
<head>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
</head>
Now when i launch the portal the favicon appears in the address bar. But this is working only on Mozilla Firefox. I cant see the favicon in IE.
Anybody any ideas?
Many Thanks,
Akhilesh
Hi
We@SDN also had problems with IE. It appears that IE has real problems with favicons when using HTTPS. It normally works on HTTP, but we can't get it to work on HTTPS. I believe the only way of doing this is for the URL to the icon, as mentioned below, is using an absolute URL using http, instead of HTTPS
I hope this makes some sort of sense
D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In which case its probably because IE uses the icon as a favourites icon.
Make sure you have this code in the output HTML
<link rel="ICON" href="favicon.ico" type="image/x-icon" />
<link rel="SHORTCUT ICON" href="favicon.ico" type="image/x-icon" />
Then, load the page in HTTP and add the page to your favourites. This should get saved with the icon. Then, any subsequent accesses you should get the icon in the address bar.
I have just tried this with SDN, using HTTP, and it works fine
D
Hi Darrell,
I put teh lines of code that you sent in the <head> tag of my masthead iview. The image is in the \irj\root folder.
When i launch the portal and view source the following is there
<head>
<link rel="ICON" href="favicon.ico" type="image/x-icon" />
<link rel="SHORTCUT ICON" href="favicon.ico" type="image/x-icon" />
</head>
<script defer language="JavaScript">ur_system.is508=false;ur_language="en";;</script><script defer>sapUrMapi_Focus_RegisterCreate(null,event)</script><!--<a href="#" tabindex=0 title= "Beginning of Page" accesskey="m">
<img src="/irj/portalapps/com.sap.portal.design.portaldesigndata/themes/portal/rt/rtstd/prtl/../common/1x1.gif" border="0" style="display:none">
and much more..
Still no icon in the address bar?
1.Is there some specific place i need to add the <link rel... /> or can i add it in any component as long as that gets loaded when the portal loads?
2. does the size of the icon matter? mine is 32X32 px icon.
Thanks, Akhilesh
Hi Darrell,
If i access SDN via HTTP i can see the favicon. Yes, you are correct the HTML looks different in SDN and my portal. In SDN the following lines are at the top before any component is rendered
<link rel="ICON" href="https://answers.sap.com/irj/portalapps/com.sap.sdn.framework.lite/images/sdn.ico" type="image/x-icon" />
<link rel="SHORTCUT ICON" href="https://answers.sap.com/irj/portalapps/com.sap.sdn.framework.lite/images/sdn.ico" type="image/x-icon" />
Whereas in my code, since i have modifed the masthead to include these lines, they appear much down in a sepaarte <HEAD> section. the link inclusion is not in the standard portal <HEAD> section which also has CSS etc files.
Can you let me know what component in SDN adds the favicon in the <HEAD>?
Thanks, Akhilesh
Ahahahah. We have the problem then. You are not supposed to have multiple <head></head> sections in HTML, and I believe the second <head> section will be ignored. This is why it isn't working.
Ok, I believe that there are several ways in which you can accomplish this.
1)You can create a DocumentHook. This is similar to a user exit, where your code will be executed at certain points within the page building. This should be documented on help.sap.com.
2) You can create a simple component which can manipulate the HTML document directly before it is output to the client. You can do this using the following code
IPortalNode portalNode = request.getNode().getPortalNode();
IPortalResponse portalResponse = (IPortalResponse)portalNode.getValue(IPortalResponse.class.getName());
HtmlDocument htmlDocument = null;
if ( portalResponse instanceof PortalHtmlResponse ){
PortalHtmlResponse htmlResponse = (PortalHtmlResponse)portalResponse;
htmlDocument = htmlResponse.getHtmlDocument();
HtmlHead head = null;
if ( htmlDocument != null ){
head = htmlDocument.getHead();
htmlHead.addElement(toAdd);
}
}
I hope this helps
Darrell
Hi Akhilesh,
We r also tring to put our portal favicon, but we can't find where we cahange that code :
<head>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
</head>
pls give me exact path
thanks for advance
Navaneethan
navaneethan.81@gmail.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akhilesh,
have you created a real .ico or just renamed a .gif or .bmp to .ico? IE is very strict with handling of non-real .ico files.
Give this a try: in IE click and hold the little IE icon to the left of "http://...." in the adress bar of IE. Drag it some millimeters to the right and release the click. Repeat this several times - maybe the icon is appearing like magic
Maybe delete the type declaration in the link. Just a try...
Hth,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.