Topic: How can I use a favicon?

I have Showkase installed in a subdirectory from the root directory.  Everything works fine, but I'd like to use my old favicon.  I placed it in both the root directory and in the Showkase directory, but it still isn't being picked up.

A forum search gave me one result, but its from 2014 (this forum won't let me post the link) and the file and code don't match my Showkase Pro 1.6.1, so I was hesitant to proceed with any experimentation. 

Can someone please tell me where to put my favicon and what code insertions/changes are necessary to make it work?

Re: How can I use a favicon?

I expect you've seen this forum post.
The instructions were accurate at the time (2 years ago) but things have changed slightly since then. (There are now certain files that are shared between all themes.)

If you've already put your 'favicon.ico' file in your root directory (not necessarily the same as your Showkase root directory) and it's not being picked up by your browser, then add the following code to your 'showkase/_themes/base/pagetypes/basetheme.tpl' file in the {block "stylelinks"} ... {/block} section between lines 27 and 30 (alongside the other <link> tags.

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

You can change the location of your 'favicon.ico' file if you like (it does not need to be in your root directory) but just make sure that the path to the file is correct in the 'href' attribute of the <link> tag.

Be sure to publish your site afterwards (just click the 'Publish' button) to have this <link> tag inserted into all your pre-existing Showkase pages.

Please note that the file and line numbers above refer to the current version of Showkase (v1.6.1).
If you are not already using the current version, then you might like to upgrade your site following the instructions here.
For a list of changes between versions, please see the Version History.

Incidentally, once you've posted a couple of posts, you should hopefully be able to include links. (Otherwise, you can disguise the links by inserting spaces between slashes or leaving out the http:// part.)

Re: How can I use a favicon?

Thank you for the reply Steven.

I found the file and code.  It was just as you described.  I have v1.6.1.
I pasted in the line of code using Notepad++ and dropped the ico file into the web root directory, but it doesn't seem to work.  I also tried dropping the ICO file into the main showcase directory), but that didn't help either.

I'll keep working at it to try and figure out what I'm doing wrong.

{block "stylelinks"}
    <link rel="stylesheet" href="{$ss_themeUrl}/css/styles.css">
    <link rel="stylesheet" href="{$ss_themeUrl}/css/custom.css">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
{/block}

Re: How can I use a favicon?

It looks like the line of code is in the correct place.
Here are a few things to check.

(1) After making the change to the 'basetheme.tpl' file and re-publishing your site, check the source of one of your Showkase pages in your browser to make sure that the code is present in the page.

(2) Check that the favicon file has been uploaded to your web server and ensure that the path to the favicon file (the 'href' attribute in the <link> tag) is correct.

(3) If your favicon is not an 'ico' file (and is perhaps a 'png' or a 'gif' file instead), then make sure that its file extension is correct and change the 'type' attribute in the <link> tag as appropriate:

<link rel="icon" href="http://example.com/favicon.ico" type="image/x-icon">
<link rel="icon" href="http://example.com/favicon.png" type="image/png">
<link rel="icon" href="http://example.com/favicon.gif" type="image/gif">

(4) Try using an absolute path (like in the examples in #3 above) instead of a relative path for the 'href' attribute in the <link> tag.

Hopefully these suggestions will help.
However, if you continue to experience difficulties, please post a link to your Showkase site so that I can take a look at things for myself and hopefully help further.
Thank you.

Re: How can I use a favicon?

Still not working. 

I can see the icon on the screen (not the tab) when I go to  kruegerphoto.com/favicon.ico
so I know it's there in the root directory. 

I'm not entirely sure this isn't a Firefox issue, but it displays other favicons correctly, including the one from my other site: cityshadows.org

Re: How can I use a favicon?

Thank you for the link to your Showkase site.
Your favicon displays OK in the browser tab when I view your Showkase site in Firefox 51.0.1 on my PC (and everything looks OK: your <link> tag is in place, your 'favicon.ico' file is in place and your <link> tag's 'href' attribute is correct).
Try completely clearing your browser's cache before reloading your web site. Hopefully this will resolve your problem.

Re: How can I use a favicon?

Thanks for taking the time to help me with this.  I think I figured it out and now I'm embarrassed for not thinking of this.

I have KeePass Helper installed on my browser which modifies the page title to make sure my KeePass password safe recognizes what website I'm visiting so it knows what password to use.  It apparently interferes with the way the favicon displays on the tab.  After I disabled it, the icon displayed correctly.   I installed that app so long ago I forgot about it.

My apologies for dragging you down this rabbit hole.  I was afraid it might turn out to be something stupid like this.

By the way, so far I have been extremely impressed with ShowKase.  It works perfectly for me and I love all the config options.  I also like that it doesn't break whenever there's a Wordpress update like my last web gallery experiment.

Thanks again for your help.

Re: How can I use a favicon?

You're welcome.
I'm glad that you've been able to resolve your problem.
Thank you for taking the time to let me know and for detailing the reason for the problem.
Hopefully it will help out any other users experiencing similar symptoms.

By the way, so far I have been extremely impressed with ShowKase.  It works perfectly for me and I love all the config options.  I also like that it doesn't break whenever there's a Wordpress update like my last web gallery experiment.

That's really great to hear! We're glad you're getting on well with Showkase!

9 (edited by alfavite 2017-03-18 08:53:00)

Re: How can I use a favicon?

Tell me please, and the favicon may not appear correctly when you come to the site via VPN or proxy connection? You know, this should not influence, but after my changes with favicon.

Re: How can I use a favicon?

@alfavite

As far as I am aware, favicons should display correctly when using a VPN or proxy (at least they do when I try the free VPN built into Opera of the KProxy Extension for Firefox).

When using your VPN or proxy, check to see if favicons for other sites are displayed correctly.
Also, check your own site's favicon to see if it displays correctly without using a VPN or proxy.

If your favicon is not being displayed as expected, then try adding a <link> tag in your 'basetheme.tpl' file (as I suggested in this post above).

Failing that, I would recommend that you contact your VPN service provider to see if they can help further. (It does not sound like an issue directly related to Showkase but rather a VPN/proxy/favicon issue.)

Re: How can I use a favicon?

this method still works like a charm in 2022 with Showkase 1.7.6, thanks a lot!

Re: How can I use a favicon?

... and 2023.