Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding additional images to the main header

Adding additional images to the main header

Locked

Views: 2,045

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
9 Nov 2010, 6:25 AM
#1
shanesoine avatar

shanesoine

Zen Follower

Join Date:
May 2010
Posts:
125
Plugin Contributions:
0

Adding additional images to the main header

I need to add additional images to my main header and using firebug see that a clever zenner did this!

<div id="logoWrapper">
<div class="back" id="logo"><a href="http://www.aaa.aa/"><img height="138" width="316" title=" title " alt="title" src="includes/templates/custom/images/title.jpg"></a></div>
<div class="forward"><a href="http://www.aaa.aa/index.php?main_page=corporate_sales"><img height="138" width="322" title=" title " alt="title" src="includes/templates/custom/images/logosecond.jpg"></a></div>
<div id="logothird"><img height="40" width="256" title=" title " alt="title" src="includes/templates/custom/images/logothird.jpg"></div>
<br class="clearBoth">

</div>

and if I look for div id="logowrapper" using developers tools in admin it directs me to
/includes/templates/template_default/common/tpl_header.php

not a natural born coder so when I go there bit overwhelmed - it all seems to be calling on other stuff or directing to other stuff:

<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>

Where should I be looking??

9 Nov 2010, 10:49 AM
#2
stevesh avatar

stevesh

Black Belt

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

Re: Adding additional images to the main header

Not sure what you're asking. You can just add HTML to template files, as the example you referenced did:
**

<div id="logothird"><img height="40" width="256" title=" title " alt="title"src="includes/templates/custom/images/logothird.jpg"></div>**

just adds an image to the header, and giving it its own id allows you to style it or move it around by editing that id in the stylesheet.

9 Nov 2010, 1:07 PM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Adding additional images to the main header

You would want to be adding the new div just after the closing </div> of the id="logo" div. Count tags if necessary to be sure you are in the right place.

If you want the other images to be home links as well, you can make an exact copy of the logo div code (changing the id to logoSecond and HEADER_LOGO_IMAGE to 'your_image_name.gif'). If you don't want links, you can subtract all of the <a...> </a> tags in the copy.

The example you give has the second logo linking to the corporate_sales page instead of home, while the third logo is not a link.

11 Nov 2010, 5:58 AM
#4
shanesoine avatar

shanesoine

Zen Follower

Join Date:
May 2010
Posts:
125
Plugin Contributions:
0

Re: Adding additional images to the main header

Hi Guys, many thanks for your help, just lost on which file I should be making these changes in?

11 Nov 2010, 8:53 AM
#6
shanesoine avatar

shanesoine

Zen Follower

Join Date:
May 2010
Posts:
125
Plugin Contributions:
0

Re: Adding additional images to the main header

Hi sorry I know you show a lot of patience with people like me but may I just confirm that I would be getting rid of this

<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>

and replacing it with the div class info for my chosen images??

Feels wrong

or would I add another div after it?

While i am on the subject of things i struggle with need to add some script to the head and body of my index.php (home page) but cant see the tags

11 Nov 2010, 8:58 AM
#7
shanesoine avatar

shanesoine

Zen Follower

Join Date:
May 2010
Posts:
125
Plugin Contributions:
0

Re: Adding additional images to the main header

Spotted something i may have done wrong - I only have a common folder in my template_default folder - should I have made a copy of common and put it in mytemplate - I am using classic and have not re named it yet

11 Nov 2010, 9:51 AM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Adding additional images to the main header

If you want multiple images, you need to add the new div(s) after the original logo div.
Never change a file in a /template_default/ folder; make a copy of it in a /your_template/ folder (or /your_template/common/ in this case), and edit that.

13 Nov 2010, 7:13 AM
#9
shanesoine avatar

shanesoine

Zen Follower

Join Date:
May 2010
Posts:
125
Plugin Contributions:
0

Re: Adding additional images to the main header

Thanks so much for the wonderful clear instructions, makes such a difference to understanding whats going on. Do you think I should change the name of classic, read somewhere it could pose a problem if I ever work up the courage to up grade. If so what would be the overall implications?

13 Nov 2010, 8:20 AM
#10
shanesoine avatar

shanesoine

Zen Follower

Join Date:
May 2010
Posts:
125
Plugin Contributions:
0

Re: Adding additional images to the main header

Ok in principle that went quite well, I put the following in:

<div id="middlelogo"><img height="240" width="480" title=" title " alt="title" src="includes/templates/custom/images/middlelogo.png"></div> <div id="xmaslogo"><img height="240" width="158" title=" title " alt="title" src="includes/templates/custom/images/xmaslogo.png"></div> <br class="clearBoth"> </div>

So while both images come up, the xmaslogo one sits underneath the middlelogo

How would I make it sit on the right

13 Nov 2010, 8:39 AM
#11
shanesoine avatar

shanesoine

Zen Follower

Join Date:
May 2010
Posts:
125
Plugin Contributions:
0

Re: Adding additional images to the main header

on reflection that was not a thought thro request - I understand i should make a change in my stylesheet.css just a little unsure of how now i have the default

#logo {float: left;}

how do i give each image a position?

13 Nov 2010, 5:57 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: Adding additional images to the main header

You can make the #middlelogo and #xmaslogo float: left;
#xmaslogo could float right if there is extra space and you want it to hug the right edge of the header.

18 Nov 2010, 6:08 AM
#13
pet_herbal_remedies avatar

pet_herbal_remedies

Zen Follower

Join Date:
Aug 2008
Posts:
162
Plugin Contributions:
0

Re: Adding additional images to the main header

Hi There,

This has been a tremendous help to me but I have a little glitch.

I entered similar div into tpl_header.php

<div id="rightlogo"><img height="187" width="150" title=" title " alt="title" src="includes/templates/all_business/images/clelogo.png"></div>

and I've been playing around with it in css which is:

#rightlogo {
float:right;
padding-right:25px;
padding-top:25px;}

But I can't seem to get the cle hospitality logo on the right hand side and the home/log in/shopping cart in the middle. I was able to move the home/login/shopping cart but then the logo was stuck in the middle as well. I'm not sure what I'm doing wrong but I'd greatly appreciate some insight.:unsure:

http://marketcafe-online.com

Also, how do I enter the URL into the <div so that the logo links and opens in a new page, to an external URL? Much much appreciated, Lynn

18 Nov 2010, 9:46 AM
#14
shanesoine avatar

shanesoine

Zen Follower

Join Date:
May 2010
Posts:
125
Plugin Contributions:
0

Re: Adding additional images to the main header

Hope this will help - first time I have posted a solution rather than a cry for help - I used <a> to split the logos and position them in tpl_header

stripeyfrog . com

18 Nov 2010, 2:03 PM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: Adding additional images to the main header

You have done everything right except for accounting for the behavior of "float: right;". You have both the navbar and the cle logo floated right, and the first one in the code floats first and ends up farthest right. You could move the new div to just above the navMain list in the code, or you could remove the float on the navbar list.

stylesheet.css (line 61)
#navMain ul {
float:right;/*change to none */
line-height:1.5em;
list-style-type:none;
margin:0;
padding:0.5em 5em;
position:relative;
right:14px;
text-align:center;
top:40px;
}

18 Nov 2010, 4:39 PM
#16
pet_herbal_remedies avatar

pet_herbal_remedies

Zen Follower

Join Date:
Aug 2008
Posts:
162
Plugin Contributions:
0

Re: Adding additional images to the main header

Thank you so much! :clap:

Plus I figured out how to do add a link to it so that the code in tpl_header.php looks like this:

<div id="rightlogo"><a target="_blank" href="http://www.clehospitality.com/"><img height="87" width="150" title=" title " alt="title" src="includes/templates/all_business/images/clelogo.png"></div>

If possible, I have one more question regarding opening ez pages in a new page. I'm aware of the external links but can't figure out how to direct open in a new page in the URL space?

18 Nov 2010, 5:11 PM
#17
pet_herbal_remedies avatar

pet_herbal_remedies

Zen Follower

Join Date:
Aug 2008
Posts:
162
Plugin Contributions:
0

Re: Adding additional images to the main header

Scratch the last question I just discovered that there's an option within the EZ page :blush: