Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / 2 favicons on one site [one on secure pages and a different one on non-secure pages]

2 favicons on one site [one on secure pages and a different one on non-secure pages]

Locked

Started by dharma on 12 Feb 2007, 5:38 PM · Views: 6,758

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
12 Feb 2007, 5:38 PM
#1
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Post #1 by dharma

I have two favicons:

one for my main site and the same one with a lock on it for my secure pages.

How do I make web browsers select the correct favicon?

I looked through the forums, but have not found anything regarding 2 favicons.

below is a related forum from 3 years ago that mentions a define and meta tags, would I do something like this and then use a variable like this? $_SERVER['HTTPS']:

is there any easier way?

http://www.zen-cart.com/forum/showpost.php?p=15579&postcount=10

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

14 Feb 2007, 12:21 AM
#2
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Post #2 by dharma

It looks like the code from the above forum is already in ZC. Would it be a matter of making a new "define" and an "if" statement somewhere?

place the regular favicon in the root and secure favicon in the folder: images?

Kind of guessing here::blink:

// favicon setting
// There is usually NO need to enable this unless you wish to specify a path and/or a different filename
define('FAVICON', 'favicon.ico');
<?php if (defined('FAVICON')) { ?>
<link rel="icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo FAVICON; ?>" type="image/x-icon" />
<?php } //endif FAVICON ?>
define('FAVICON_CODE','<link rel="icon" href="/images/favicon.ico" type="image/x-icon" />'.'<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />');

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

14 Feb 2007, 1:19 AM
#3
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,761
Plugin Contributions:
0

Post #3 by Kim

...this is probably a silly question, but why would you want to have 2 favicons?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

14 Feb 2007, 1:35 AM
#4
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Post #4 by dharma

Perhaps it is unnecessary, but I have seen this on some other sites and thought it was a nice touch. It reinforces that the pages are secure.

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

14 Feb 2007, 1:48 AM
#5
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,761
Plugin Contributions:
0

Post #5 by Kim

okay- can't say as I have ever seen the site's favicon change. I have seen locks appear when a page is secure, but that is a browser function. Maybe Google for multiple favicons? A URL of an example site where you have seen this?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

14 Feb 2007, 1:56 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #6 by kobra

If you want to put the favicon in a different place, give it a different name, or use multiple favicons for multiple pages, you can tell a web page which favicon to use by inserting the following line of code between the tags of your HTML. Just change the link to the address you need:

<link rel="shortcut icon" href="http://www.website.com/images/myicon.ico">

Link = http://resources.bravenet.com/articles/design/graphics/how_favicons_work/

Zen-Venom Get Bitten

14 Feb 2007, 2:11 AM
#7
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Post #7 by dharma

I can't find an example site off hand, perhaps I will start with kobra's suggestion/link and try to apply it to ZC php.

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41

15 Feb 2007, 2:00 AM
#8
dharma avatar

dharma

Totally Zenned

Join Date:
Nov 2006
Posts:
505
Plugin Contributions:
0

Post #8 by dharma

This seems to work using 2 favicons:

one in the root
and the alternate one in images

I placed the code provided by Kobra above (thank You!) in my template override folder for each of the secure pages I wanted the "locked" favicon,: login, check out etc...I placed the code at the top of the page, as I guessed that would be the place for it.

Its easy to get carried away adding the locked favicon to all the secure pages, but I would recommend if you do this, keep it simple (less amount of pages/OR):bored:

If someone has a cleaner way/better please post...

 * @version $Id: tpl_login_default.php 5419 2006-12-28 05:56:39Z drbyte $
 */
?>
<link rel="shortcut icon" href="/images/myicon.ico">
<div class="centerColumn" id="loginDefault">

Zencart 1.3.9h - PHP 5.2.13 - My SQL 5.0.84 - Apache 1.3.41