2
votes

I want to set a favicon in XPages. I am using Domino 8.5.3 with the latest 8.5.x version of the extlib. As application theme oneuiv2.1 is used.

I tried setting the pageIcon attribute in the XPage without success. Adding a link attribute to the header using

<xp:this.resources>
    <xp:headTag tagName="link" rendered="true" loaded="true">
        <xp:this.attributes>
            <xp:parameter name="rel" value="icon"></xp:parameter>
            <xp:parameter name="href" value="favIcon.png">
            </xp:parameter>
            <xp:parameter name="type" value="image/png">
            </xp:parameter>
        </xp:this.attributes>
    </xp:headTag>
</xp:this.resources>

did not change the favicon. I found in various blogs, that I have to add a control to the application theme, for example:

<control>
    <property>
        <name>pageIcon</name>
        <value>favicon.ico</value>
    </property>
</control>

However I use the provided oneUi theme and do not want to create a custom theme. Is there a way to either set the favicon directly or modify the theme without creating a complete new one?

3
pageIcon should work. Do you have a corresponding image resource in the application? (Apologies if that's a silly question)Paul Stephen Withers
I placed both a .png and .ico image under Resources/Images and signed them. I could access both from the browser (I also tried using absolute paths). Is there a difference setting the pageIcon in an xpage or a custom control?user1051934
I think favicon is site specific (default url browser looks for is immediately after site name). So you can just put right image to server's domino/html directory. Do you want different icons for every application?Frantisek Kossuth
I placed a file myfavicon.ico in data/domino/http and pointed the pageIcon attribute to it: <xp:view xmlns:xp="ibm.com/xsp/core" xmlns:xc="ibm.com/xsp/custom" pageIcon="/myfavicon.ico"> Unfortunately it does not change. If I change the default file domino/http/favicon.ico it is displayed correctly. Unfortunately I need different icons in different applications.user1051934
Unfortunately strange company policies. I think I found the problem, there seemed to be issues with clear history and favicons in the internet explorer 11. Both methods - xp:headTag and pageIcon - work. I am sorry for my mistake. Thank you for the help.user1051934

3 Answers

1
votes

I think you are missing the control name in your theme rule.

Here is the syntax of the theme rule that works for me. (Taken from Tim Tripcony's HowYaBean demo application referenced on NotesIn9 and downloadable from here). I use it a ton. It takes the icon from the NotesDatabase (remember the one from the old Notes workspace that has not yet been pried out of my cold dead fingers). It also works with image or file resources.

<control override="false">
    <name>ViewRoot</name>
    <property>
        <name>pageIcon</name>
        <value>/$icon</value>
    </property>
    <property>
        <name>pageTitle</name>
        <value>#{database.title}</value>
    </property>
</control>
0
votes

This works for me - icon shows in tab bar and shortcut created from application URL.

Image resource (PNG image) with name img_ApplicationIcon16. The name is generic for every application, but each NSF contains different image.

Every XPage has property pageIcon="/img_ApplicationIcon16"

It renders as <link rel="SHORTCUT ICON" href="/path/database.nsf/img_ApplicationIcon16">

In my case, I did not want to use theme, too.

0
votes
  1. Import the favicon.ico file as file resource instead of image resource
  2. Add the following code to the selected theme:

<control> <name>ViewRoot</name> <property> <name>pageIcon</name> <value>/favicon.ico</value> </property> </control>

  1. Set up the application to use the theme containing the reference for the favicon.
  2. Create a new xpage for testing, or delete the browser cache.

This works for me properly. In the browser window you should see the folloving source:

<link rel="SHORTCUT ICON" href="/db.nsf/favicon.ico">

(db.nsf is your database.)

If still not work check the xpage: "All properties-styling-disableTheme" should not be enabled.