Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Specifying unique favicon for admin

Specifying unique favicon for admin

Views: 1,839

Results 1 to 11 of 11
29 Dec 2011, 4:55 AM
#1
ronlee67 avatar

ronlee67

Totally Zenned

Join Date:
Sep 2006
Location:
Colorado Springs CO USA
Posts:
519
Plugin Contributions:
0

Specifying unique favicon for admin

I have two Zencart shops on the same domain. We sell chemicals (adhesive remover). We have to provide a different product line for California customers due to state regulations. A separate Zencart is needed in order to prevent the wrong chemical formula from being shipped to California customers.

I set up the Zencart for regular products in the webserver root, and the California VOC products in a Zencart located in a subdirectory of the root. That subdirectory is named voc/.

Different favicons are used for each cart.
The favicon for regular products is located a /favicon.ico
/includes/languages/english/[MY TEMPLATE]/meta.tags has this definition: define('FAVICON','/favicon.ico');

The favicon for California VOC products is located at /voc/favicon.ico
/includes/languages/english/[MY TEMPLATE]/meta.tags has this definition: define('FAVICON','voc/favicon.ico');

The favicon for regular products is correctly displayed for all pages associated with that cart including the admin pages.

However, the favicons associated with the cart located in the /voc subdirectory are only correct for the customer pages. The VOC admin area pages display the favicon installed in the webserver root (wrong). The favicon installed at /voc/favicon.ico is ignored throughout the voc admin area.

I also tried uploading the custom VOC favicon at /voc/admin/favicon.ico but that didn't fix the problem either.

Any ideas on how to display a custom favicon for the admin pages located in the voc subdirectory?

Both shops are Zencart Version 1.3.8a

Ron

29 Dec 2011, 5:43 AM
#2
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Specifying unique favicon for admin

The favicon for California VOC products is located at /voc/favicon.ico
/includes/languages/english/[MY TEMPLATE]/meta.tags has this definition: define('FAVICON','voc/favicon.ico');

Include the missing forward slash in your 'meta.tags' file

29 Dec 2011, 9:30 AM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Specifying unique favicon for admin

Why are you worrying about favicons for admin areas? The public does not go near these areas.

29 Dec 2011, 2:55 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Specifying unique favicon for admin

Something to visually distinguish which admin you are in would be useful in such a case, whether a favicon, unique tab title or admin page logo.

29 Dec 2011, 3:54 PM
#5
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Specifying unique favicon for admin

I just change the basic colors of the admin area in the stylesheet and upload a different logo.

29 Dec 2011, 5:05 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Specifying unique favicon for admin

Yes, that would be the most visible reminder of which admin you are in.

29 Dec 2011, 5:21 PM
#7
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Specifying unique favicon for admin

gjh42:

Something to visually distinguish which admin you are in would be useful in such a case, whether a favicon, unique tab title or admin page logo.

According to: docs/important_site_security_recommendations.html (in a download of the software), having additional tabs open while working in admin may pose a security issue:

It is wise to observe caution while working in your admin area:

use only one browser tab to access your admin area
do NOT visit other sites when your browser has an active admin login session enabled even in another tab
always log out of your admin when not using it

Would this advice still apply when logged into two separate admin areas?

30 Dec 2011, 9:22 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Specifying unique favicon for admin

I suppose so, but even if only one is open, a reminder of which one it is would be good.

13 Jan 2012, 8:14 PM
#9
ronlee67 avatar

ronlee67

Totally Zenned

Join Date:
Sep 2006
Location:
Colorado Springs CO USA
Posts:
519
Plugin Contributions:
0

Re: Specifying unique favicon for admin

fairestcape:

According to: docs/important_site_security_recommendations.html (in a download of the software), having additional tabs open while working in admin may pose a security issue:

Would this advice still apply when logged into two separate admin areas?

First, thanks to everyone who responded.

Regarding the security issue, I wonder if that still applies if both carts are on the same server and domain. I routinely left all my site admins (4 carts) open on separate tabs. Discontinuing that practice. I appreciate that advice.

Ron

13 Jan 2012, 8:44 PM
#10
ronlee67 avatar

ronlee67

Totally Zenned

Join Date:
Sep 2006
Location:
Colorado Springs CO USA
Posts:
519
Plugin Contributions:
0

Re: Specifying unique favicon for admin

Website Rob:

The favicon for California VOC products is located at /voc/favicon.ico
/includes/languages/english/[MY TEMPLATE]/meta.tags has this definition: define('FAVICON','voc/favicon.ico');

Include the missing forward slash in your 'meta.tags' file

Thanks Website Rob for the response:

I failed to put the slash in the post. It is actually there in the file. I checked the original install files and they come without the leading slash. I removed the leading slash but it didn't make any difference.

Then it dawned on me that the admin area does not support custom template overrides, so I made the change directly in the meta.tags file at /voc/includes/languages/english, but again, the admin area pages continue to pickup the favicon.ico from the root directory. I even tried putting in the full path (http://www..../voc/favicon.ico.) in the metatags.php file but it did not change the result.

The problem is limited to the admin area pages. It does not appear in catalog pages.

And for the other contributors, yes my reason for this is to avoid confusion as to which similar looking shop I am working in at the moment. I do use use a green motif on the admin pages for the voc products, but when selecting browser tabs, that motif is not visible until the tab has been selected. A different favicon helps to distinquish which tab to select.

I think the reason it works for the catalog pages is because the custom template overrides the default metatags.php definitions. I need a way for the admin pages to do likewise, but that might have to wait until/if a templates override feature is established for admin pages in a future version of Zencart.

13 Jan 2012, 11:15 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Specifying unique favicon for admin

The admin pages in v1.3.x don't share enough common code to allow you to generically make one single change that affects favicons or any other <head> section tags on all pages universally.

If you are happy to set it only for your admin home page, you can make the following alteration to your /admin/index.php file:```

<head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <meta name="robot" content="noindex, nofollow" /> [B]<link rel="icon" href="/path/to/custom/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="/path/to/custom/favicon.ico" type="image/x-icon" /> [/B]<script language="JavaScript" src="includes/menu.js" type="text/JavaScript"></script> ```You might consider similarly for the /admin/login.php file. * ALERT TO OTHERS WHO MIGHT READ THIS POST ... This code suggestion is ONLY for the ADMIN section. If you're mucking with favicons for your storefront, see the FAQ tutorial article for proper instructions there, since there is NO NEED to add these <link> tags in the storefront for favicon support.*