Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding 2nd logo / picture to header

Adding 2nd logo / picture to header

Views: 6,465

Results 1 to 20 of 27
27 Feb 2010, 9:21 PM
#1
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Adding 2nd logo / picture to header

ver. 1.3.7.1 How do I add a second logo / picture to my website on the right side (already have one on the left) in the header? website is: https://www.pazdarwinery.com

27 Feb 2010, 9:37 PM
#2
kobra avatar

kobra

Black Belt

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

Re: Adding 2nd logo / picture to header

Modify a copy of tpl_header.php and add a div with the image src link and float it right

Zen-Venom Get Bitten

28 Feb 2010, 1:24 AM
#3
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

I tried adding the following:

<div> <img src="includes/templates/templates_default/images/aztecking.gif" float:right;> </div>

It didn't work, any ideas?

Thanks,

David

28 Feb 2010, 6:42 AM
#4
kobra avatar

kobra

Black Belt

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

Re: Adding 2nd logo / picture to header

It didn't work, any ideas?

<img src="includes/templates/templates_default/images/aztecking.gif" float:right;>

Your div should have an ID and the float does not belong there
It should be in your stylesheet.css file
Template_default is most likely/should not be your active template
Check what is active in admin > tools > template selection - and place your image there and code to reflect that

Zen-Venom Get Bitten

28 Feb 2010, 5:59 PM
#5
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

In the

includes/languages/english/classics/header.php

I added:

define('HEADER_LOGO2_WIDTH', '192px');
define('HEADER_LOGO2_HEIGHT', '64px');
define('HEADER_LOGO2_IMAGE', 'aztecking.GIF');

In the:

templates/template_default/css/stylesheet.css

I added:

#LOGO2 {float: right;}

In the templates/template_default/common/tpl_header.php

I added:

<div id="header_logo2_image"> </div>

I also tried changing, just to see if it could be done, the #logo (which I thought was my current logo) to float right. That didn't do anything

1 Mar 2010, 4:10 AM
#6
kobra avatar

kobra

Black Belt

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

Re: Adding 2nd logo / picture to header

I also tried changing, just to see if it could be done, the #logo (which I thought was my current logo) to float right. That didn't do anything
You are apparently not doing things right or in the correct file locations if you are changing things and not seeing any alteration

Zen-Venom Get Bitten

1 Mar 2010, 12:56 PM
#7
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

I suspect that I may have "messed" up those files 2 years ago when I originally installed zen-cart and didn't know anything about html. I would like to start fixing this by trying to reload those particular files. Where can I download fresh copies of them (ver. 1.3.7.1)?

Thanks for your help on this.

2 Mar 2010, 3:52 AM
#8
kobra avatar

kobra

Black Belt

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

Re: Adding 2nd logo / picture to header

Where can I download fresh copies of them (ver. 1.3.7.1)?
From the download link on the home page of this site -
All releases are available

You should consider upgrading...

Zen-Venom Get Bitten

4 Mar 2010, 4:55 PM
#9
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

pazdar:

In the

includes/languages/english/classics/header.php

I added:

define('HEADER_LOGO2_WIDTH', '192px');
define('HEADER_LOGO2_HEIGHT', '64px');
define('HEADER_LOGO2_IMAGE', 'aztecking.GIF');

In the:

templates/template_default/css/stylesheet.css

I added:

#LOGO2 {float: right;}

In the templates/template_default/common/tpl_header.php

I added:

<div id="header_logo2_image"> </div>

I also tried changing, just to see if it could be done, the #logo (which I thought was my current logo) to float right. That didn't do anything

This is almost correct, I modified this to get it working on my site. But I am still experiencing problems with resizing the image.

Here is what I changed form above

First off you must be sure you are editing the files for the template you are using and not the default template(unless you are using that)

Second find what directory your logo is stored. Right click on the image and choose "View Image"

Put your second image in the same directory

Now instead of

templates/template_default/css/stylesheet.css

#LOGO2 {float: right;}
use lowercase
#logo2 {float: right;}

Instead of

In the templates/template_default/common/tpl_header.php

<div id="header_logo2_image"> </div> use <div id="logo2"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO2_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO2_IMAGE, HEADER_LOGO2_WIDTH, HEADER_LOGO2_HEIGHT) . '</a>'; ?></div>

You see the original doesn't tell the template where to get the image form this new code is a copy of the code that displays the original logo with modification from logo to logo2

I will post back if when I get the image sizing working.

4 Mar 2010, 5:05 PM
#10
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

Ok I figured out the sizing problem, i was missing something

Change

<div id="logo2"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO2_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO2_IMAGE, HEADER_LOGO2_WIDTH, HEADER_LOGO2_HEIGHT) . '</a>'; ?></div>

to

<div id="logo2"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO2_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO2_IMAGE, HEADER_ALT_TEXT, HEADER_LOGO2_WIDTH, HEADER_LOGO2_HEIGHT) . '</a>'; ?></div>
4 Mar 2010, 7:11 PM
#11
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

Thank you Hornsales! It works except that logo2 floats left. Below is the section from my css starting with "LABEL", is it correct or do I have a simple error?

LABEL.checkboxLabel, LABEL.radioButtonLabel {
margin: 0.5em 0.3em;
}

.centerBoxContents, .specialsListBoxContents, .categoryListBoxContents, .centerBoxContentsAlsoPurch, .attribImg {
float: left;
}

#logo {float: left;}

#logo2 {float: right;}

4 Mar 2010, 7:34 PM
#12
kobra avatar

kobra

Black Belt

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

Re: Adding 2nd logo / picture to header

You have altered some of the basics in your template such as the mainWrapper that stops with you header

Would have to scrutinize many elements of what and how you have this coded

Zen-Venom Get Bitten

4 Mar 2010, 7:41 PM
#13
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

That looks like mine.

here's the thing if its not floating right, then you probably have a typo or a mis capitalization some where in one of the other 2 files.

The capitalization is very important.

Or you could still be editing the wrong files

I did not edit anything that was in a template_default folder.

Be sure you are editing the correct files for your current template.

I am by no means an expert on this I basically take what other people post and play around with it to suite my own needs and have been lucky enough to get it right most times.

I just happened to be wanting to add a second image today, and saw your post. Realized you had most of it right but were possibly using the wrong files and missing something.

So I looked through the 3 files you listed for the term "logo"
Figured out what controls the original logo. Copied that text and pasted it back in and changed all instances of logo to logo2. made the modifications for the file name and image size, then changed left to right for the float.

Now my css file looks nothing like yours since I am using a different template then you.

Now I will give you a trick to know which css file is actually being used for sure. Open you home page, right click and choose View Page Source.

A few lines down it should show you the full path of the css file being used.

hope that helps

4 Mar 2010, 9:55 PM
#14
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

Hornsales, exactly where in the tpl_header.php did you put the

<div id="logo2"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO2_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO2_IMAGE, HEADER_ALT_TEXT, HEADER_LOGO2_WIDTH, HEADER_LOGO2_HEIGHT) . '</a>'; ?></div>

?

Thanks

4 Mar 2010, 10:08 PM
#15
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

right after the exact same line that starts

<div id="logo">
4 Mar 2010, 10:09 PM
#16
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

Hornsales:

I made 1 change to your code:

<div id="logo2><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO2_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO2_IMAGE, HEADER_LOGO2_TEXT, HEADER_LOGO2_WIDTH, HEADER_LOGO2_HEIGHT) . '</a>'; ?></div> </div>

Unless you want both logos to have the same text, you need to change the HEADER_ALT_TEXT to HEADER_LOGO2_TEXT

Then you have to add the "define('HEADER_LOGO2_TEXT'
to your header.php file

4 Mar 2010, 10:12 PM
#17
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

This is the way mine looks:

<div id="logoWrapper"><div id="logo"> <?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div> <div id="logo2><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO2_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO2_IMAGE, HEADER_LOGO2_TEXT, HEADER_LOGO2_WIDTH, HEADER_LOGO2_HEIGHT) . '</a>'; ?></div> </div>

Is this the same as yours?

4 Mar 2010, 10:24 PM
#18
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

first thing I noticed is you are missing a quotation mark after the 2 in <div id="logo2>

Everything else looks good
Add that quotation mark in or else it won't work

4 Mar 2010, 10:29 PM
#19
pazdar avatar

pazdar

Zen Follower

Join Date:
Jan 2008
Posts:
174
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

BINGO! That was it!

Thanks

4 Mar 2010, 10:29 PM
#20
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Adding 2nd logo / picture to header

no problem