Forums / General Questions / Adding second image to header

Adding second image to header

Started by leoj on 7 May 2013, 12:34 AM · Views: 947

Results 1 to 6 of 6
7 May 2013, 12:34 AM
#1
leoj avatar

leoj

New Zenner

Join Date:
May 2013
Location:
New Jersey
Posts:
16
Plugin Contributions:
0

Adding second image to header

I have searched posts relevant to my question, and read FAQ sections. I have found this helpful and most of my questions are answered. I have reviewed all posts on adding a second logo in the logoWrapper. I would appreciate it if someone could review my work and let me know what I am doing wrong.

Zencart V1.5, development computer Windows 7, wamp server 2.2, MySQL 5.5.24, PHP 5.3.13, Apache 2.2.22. Host server Linux uses MySQL 5.5.24, PHP 5.3.13,Apache 2.2.24.

Am I editing these files correctly and are the files in the right place? I want a gif logo to the left and another gif logo just to the right of that. Can not seem to get it to show both. Only one image will show.

Edit for logo2 in store\includes\templates\template_default\common\magic\tpl_header.php.

<!--bof-branding display--> <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_LOGO_WIDTH, HEADER_LOGO_HEIGHT, 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_WIDTH, HEADER_LOGO2_HEIGHT, HEADER_ALT_TEXT) . '</a>'; ?></div> <?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?> <div id="taglineWrapper">

Edit for logo2 in store\includes\languages\english\magic\header.php

// added defines for header alt and text
define('HEADER_ALT_TEXT', 'Amateur Chef Home Link');
define('HEADER_SALES_TEXT', '<h1><i>For the Chef in All of Us!</i></h1>');
define('HEADER_LOGO_WIDTH', '144px');
define('HEADER_LOGO_HEIGHT', '175px');
define('HEADER_LOGO_IMAGE', 'logo.gif');
define('HEADER_LOGO2_WIDTH', '310px');
define('HEADER_LOGO2_HEIGHT', '54px');
define('HEADER_LOGO2_IMAGE', 'logo2.gif');

Edit for logo2 in store\includes\templates\magic\css\stylesheet.css

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

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

#logo2, {
float: left;
margin-left: 155px;
margin-top: 55px;
}

LABEL.inputLabel {
width: 9em;
float: left;
}

Source code when viewed via localhost.

<!--bof-branding display--> <div id="logoWrapper"> <div id="logo"><a href="http://localhost/store/"><img src="includes/templates/magic/images/logo.gif" alt="Amateur Chef Home Link" title=" Amateur Chef Home Link " width="144" height="175" /></a></div> <div id="taglineWrapper"> <div id="tagline"><h1><i>For the Chef in All of Us!</i></h1></div> </div> </div> <br class="clearBoth" /> <!--eof-branding display-->

Thanks:smile:

7 May 2013, 2:12 AM
#2
kobra avatar

kobra

Black Belt

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

Re: Adding second image to header

Try this

<div id="logo2"><img src="images/logo2.gif" alt="" width="???" height="???" /></div>

Place the image in your main images folder

Zen-Venom Get Bitten

7 May 2013, 3:42 AM
#3
leoj avatar

leoj

New Zenner

Join Date:
May 2013
Location:
New Jersey
Posts:
16
Plugin Contributions:
0

Re: Adding second image to header

No change. I reviewed all the posts regarding this subject that I could find and though I was doing this right. I'm not sure where it went wrong. Source code is unchanged as well.

7 May 2013, 5:08 PM
#4
kobra avatar

kobra

Black Belt

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

Re: Adding second image to header

Source code is unchanged as well.
Well it should have changed with the edit I posted
Post a link to your install

Zen-Venom Get Bitten

8 May 2013, 12:59 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Adding second image to header

You have a stylesheet error:

#logo2, {
float: left;
margin-left: 155px;
margin-top: 55px;
}
``` There must be no comma after the last selector (or the only one).
8 May 2013, 7:04 PM
#6
leoj avatar

leoj

New Zenner

Join Date:
May 2013
Location:
New Jersey
Posts:
16
Plugin Contributions:
0

Re: Adding second image to header

Thanks all. For some reason it was not using the override english\magic\header.php. It was still using the default ZEN file. I replaced this folder with a new one then switched templates to classic then back to my custom template and all is fine. Thanks kobra, i did not use the code but it was helpful in sorting out the problem. Thanks gjh42, the comma is gone.