Forums / Templates, Stylesheets, Page Layout / Buttons in main pg header

Buttons in main pg header

Locked
Results 1 to 20 of 23
This thread is locked. New replies are disabled.
05 Sep 2009, 23:49
#1
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Posts:
684
Plugin Contributions:
0

Buttons in main pg header

I have three new buttons I would like to put on main page in header. Currently, I used stylesheet and just added border around text. How do I add new button images instead?

Log In
My Account
Shopping Cart

It is located on Main Page top right corner in header.

Thanks, Kim
06 Sep 2009, 02:35
#2
kobra avatar

kobra

Black Belt

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

Re: Buttons in main pg header

In a copy of tpl_header.php for your template find the bof navigation area and where there are constants called for - replace with a
img src=?????? See what is highlighted in red
 <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>


Or I believe you can place the image in the define in the includes/languages/english/header.php but am not positive of the syntax(search here)
define('HEADER_TITLE_LOGIN', 'Log In');
07 Sep 2009, 02:19
#3
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Posts:
684
Plugin Contributions:
0

Re: Buttons in main pg header

kobra:

In a copy of tpl_header.php for your template find the bof navigation area and where there are constants called for - replace with a
img src=?????? See what is highlighted in red
 <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>


Or I believe you can place the image in the define in the includes/languages/english/header.php but am not positive of the syntax(search here)
define('HEADER_TITLE_LOGIN', 'Log In');


Thank you ---got that part to work. :clap:

I made buttons with advance software. I am getting a white background around button....In css stylesheet I made background color #cccccc to match header and still getting white area. Any suggestions?

Thanks, Kim
07 Sep 2009, 02:49
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Posts:
7,017
Plugin Contributions:
12

Re: Buttons in main pg header

kburner:

Thank you ---got that part to work. :clap:

I made buttons with advance software. I am getting a white background around button....In css stylesheet I made background color #cccccc to match header and still getting white area. Any suggestions?

Thanks, Kim


Make sure your software is creating the buttons on a transparent background.
07 Sep 2009, 06:26
#5
kobra avatar

kobra

Black Belt

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

Re: Buttons in main pg header

Clyde is correct they have this white matte as part of the image
07 Sep 2009, 14:38
#6
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Posts:
684
Plugin Contributions:
0

Re: Buttons in main pg header

kobra:

Clyde is correct they have this white matte as part of the image


contacted free button website:
http://www.advancewebsoft.com/downloads/free-scripts/free-oscommerce-cre-loaded-zen-cart-oscmax-button-generator-p.html

and they do not have transparent available yet.

Is there anything else I can do? maybe in stylesheet.css?

or another does anyone know of another free button website?

Thanks, Kim
07 Sep 2009, 15:17
#7
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Posts:
7,017
Plugin Contributions:
12

Re: Buttons in main pg header

kburner:

contacted free button website:
http://www.advancewebsoft.com/downloads/free-scripts/free-oscommerce-cre-loaded-zen-cart-oscmax-button-generator-p.html

and they do not have transparent available yet.

Is there anything else I can do? maybe in stylesheet.css?

or another does anyone know of another free button website?

Thanks, Kim


Try this one it allows you to select a background color for your buttons
07 Sep 2009, 15:38
#8
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Posts:
19,793
Plugin Contributions:
2

Re: Buttons in main pg header

If you like those buttons, you can open them in a graphics program (I use Photoimpact, but there are many, including Photoshop), and change that white area to #CCCCCC.

BTW, those buttons don't display properly in IE8.
07 Sep 2009, 16:41
#9
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Posts:
684
Plugin Contributions:
0

Re: Buttons in main pg header

stevesh:

If you like those buttons, you can open them in a graphics program (I use Photoimpact, but there are many, including Photoshop), and change that white area to #CCCCCC.

BTW, those buttons don't display properly in IE8.


Wow! Did not know it would be this difficult for three buttons. I went to site: http://zen-bck.mediakitchen.de/ and it will not let me do custom buttons, but found great other buttons for rest of site.

Went to http://www.grsites.com/generate/resultbyid/5307498/ and found transparency. But still getting weird stuff..so downloaded to Adobe Fireworks and still problems...finally got to work with microsoft office picture manager...

Thanks to everyone! I really appreciate it!:clap::clap::clap:
08 Sep 2009, 00:48
#10
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Posts:
19,793
Plugin Contributions:
2

Re: Buttons in main pg header

OK. but you need to check your site in IE8.
09 Sep 2009, 00:55
#11
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Posts:
684
Plugin Contributions:
0

Re: Buttons in main pg header

stevesh:

OK. but you need to check your site in IE8.


You are correct -- I can not get IE8 to work when logged in. I even added to stylesheet...

#navMain ul li a {
float: left;
margin-top: 1.2em;
margin-left: 0.1em;
margin-right: 3.5em;
padding: 0 .25em;
width: 100%; /* cancel margin fix for other browsers */
overflow: visible;
}

Works fine in FF. Also, having issues with secure/non-secure because of my social bookmarkers in my header. I have that question in another zencart forum.

Kim
11 Sep 2009, 11:54
#12
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Posts:
684
Plugin Contributions:
0

Re: Buttons in main pg header

kburner:

You are correct -- I can not get IE8 to work when logged in. I even added to stylesheet...

#navMain ul li a {
float: left;
margin-top: 1.2em;
margin-left: 0.1em;
margin-right: 3.5em;
padding: 0 .25em;
width: 100%; /* cancel margin fix for other browsers */
overflow: visible;
}

Works fine in FF. Also, having issues with secure/non-secure because of my social bookmarkers in my header. I have that question in another zencart forum.

Kim


On day #3 with buttons not lined up correctly in IE when logged in. Works fine when not logged in.

I went through stylesheet.css with:

.forward
#navmain ul li a
#navmain ul

I have tried all kinds of combinations to get this to work....and it still does not.

Am I in the correct css file? Suggestions?

Kim
11 Sep 2009, 16:03
#13
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Posts:
7,017
Plugin Contributions:
12

Re: Buttons in main pg header

kburner:

On day #3 with buttons not lined up correctly in IE when logged in. Works fine when not logged in.

I went through stylesheet.css with:

.forward
#navmain ul li a
#navmain ul

I have tried all kinds of combinations to get this to work....and it still does not.

Am I in the correct css file? Suggestions?

Kim


This is from the view page source on your site. The closing </ul> is in the wrong place it should be placed before the closing </div>. I've highlighted it below. Open includes/templates/YOUR_TEMPLATE/common/tpl_header.php and make the correction and see if that helps.

 <div id="navMain">
    <ul class="forward">
    <li><p style="text-align: left; margin-top: -5px; margin-bottom: -5px"><a href="https://www.burnerbooks.com/index.php?main_page=login"><img src="images/Login.gif" border="0" alt=""></a></li>
    <li><p style="text-align: left; margin-top: -5px; margin-bottom: -5px"><a href="https://www.burnerbooks.com/index.php?main_page=account"><img src="images/My_Account.gif" border="0" alt=""></a></li>
  <li><p style="text-align: left; margin-top: -5px; margin-bottom: -5px"><a href="http://www.burnerbooks.com/index.php?main_page=shopping_cart"><img src="images/Shopping_Cart.gif"border="0" alt=""></a></li>  

</div></ul>
11 Sep 2009, 22:26
#14
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Posts:
684
Plugin Contributions:
0

Re: Buttons in main pg header

clydejones:

This is from the view page source on your site. The closing </ul> is in the wrong place it should be placed before the closing </div>. I've highlighted it below. Open includes/templates/YOUR_TEMPLATE/common/tpl_header.php and make the correction and see if that helps.

 <div id="navMain">
    <ul class="forward">
    <li><p style="text-align: left; margin-top: -5px; margin-bottom: -5px"><a href="https://www.burnerbooks.com/index.php?main_page=login"><img src="images/Login.gif" border="0" alt=""></a></li>
    <li><p style="text-align: left; margin-top: -5px; margin-bottom: -5px"><a href="https://www.burnerbooks.com/index.php?main_page=account"><img src="images/My_Account.gif" border="0" alt=""></a></li>
  <li><p style="text-align: left; margin-top: -5px; margin-bottom: -5px"><a href="http://www.burnerbooks.com/index.php?main_page=shopping_cart"><img src="images/Shopping_Cart.gif"border="0" alt=""></a></li>  

</div></ul>


I changed coding around and still does not work. Coding needed to be in correct place. Thank you.

Which one should I put code into?

.forward
#navmain ul
#navmain ul li a

I have tried a number of combination's..any suggestions.

Thank, Kim
11 Sep 2009, 23:02
#15
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Posts:
7,017
Plugin Contributions:
12

Re: Buttons in main pg header

kburner:

I changed coding around and still does not work. Coding needed to be in correct place. Thank you.

Which one should I put code into?

.forward
#navmain ul
#navmain ul li a

I have tried a number of combination's..any suggestions.

Thank, Kim


Kim, I probably would have handled things a bit differently.

First I would have positioned the logoWrapper as relative.

Then positioned navmain as absolute and to the right.

Next I would have created a sliding door button for the <li> declarations and included that in the stylesheet instead of having those inline styles

I would have then created individual classes for each button.

.login
.account
.cart

Then the coding in tpl_header.php would have looked like this:

<div id="navMain">
<ul>
<li class="login"><a href="https://www.burnerbooks.com/index.php?main_page=login"><span>login</span></a></li>
<li class="account"><a href="https://www.burnerbooks.com/index.php?main_page=account"><span>My account</span></a></li>
<li class="cart"><a href="http://www.burnerbooks.com/index.php?main_page=shopping_cart"><span>Shopping Cart</span></a></li>
</ul>
</div>
12 Sep 2009, 00:14
#16
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Posts:
684
Plugin Contributions:
0

Re: Buttons in main pg header

clydejones:

Kim, I probably would have handled things a bit differently.

First I would have positioned the logoWrapper as relative.

Then positioned navmain as absolute and to the right.

Next I would have created a sliding door button for the <li> declarations and included that in the stylesheet instead of having those inline styles

I would have then created individual classes for each button.

.login
.account
.cart

Then the coding in tpl_header.php would have looked like this:

<div id="navMain">
<ul>
<li class="login"><a href="https://www.burnerbooks.com/index.php?main_page=login"><span>login</span></a></li>
<li class="account"><a href="https://www.burnerbooks.com/index.php?main_page=account"><span>My account</span></a></li>
<li class="cart"><a href="http://www.burnerbooks.com/index.php?main_page=shopping_cart"><span>Shopping Cart</span></a></li>
</ul>
</div>


Looks like I am doing it your way...

positioned the logoWrapper as relative.
#logoWrapper {
width: 1000px;
height: 110px;
background-image:url(../images/header_example_four.jpg);
text-align: right;
background-repeat:no-repeat;
margin: 0em;
padding: 0em;
position: relative;
}

navmain as absolute and to the right.
#navMain ul li a {
float: right;
margin-top: 1.2em;
margin-left: 0.1em;
margin-right: 3.5em;
position: absolute;
}

created a sliding door button for the <li> declarations and included that in the stylesheet instead of having those inline styles

???? not sure how to do this???

created individual classes for each button - located at end of stylesheet

.login {
}

.account {
}

.cart{
}


Kim
12 Sep 2009, 01:04
#17
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Posts:
7,017
Plugin Contributions:
12

Re: Buttons in main pg header

kburner:

Looks like I am doing it your way...

positioned the logoWrapper as relative.
#logoWrapper {
width: 1000px;
height: 110px;
background-image:url(../images/header_example_four.jpg);
text-align: right;
background-repeat:no-repeat;
margin: 0em;
padding: 0em;
position: relative;
}

navmain as absolute and to the right.
#navMain ul li a {
float: right;
margin-top: 1.2em;
margin-left: 0.1em;
margin-right: 3.5em;
position: absolute;
}

created a sliding door button for the <li> declarations and included that in the stylesheet instead of having those inline styles

???? not sure how to do this???

created individual classes for each button - located at end of stylesheet

.login {
}

.account {
}

.cart{
}


Kim


This is what your css should look like:

#navMain {
	margin:0;
	font-size: 1.1em;
	line-height: normal;
	width: 160px;
	position:absolute;
	top:5px;
	right:5px;
}
#navMain ul {margin:0;padding: 0;display:block;list-style:none;}
#navMain li a {
   padding: 8px 0 0 35px;
	height:24px;
   text-decoration:none;
   background: url(../images/tableft.gif) no-repeat left top;
   color:#000;	
}
#navMain ul li a span {
   display:block;
   background: url(../images/tabright.gif) right top;
   padding:2px 15px 2px 6px;
   }
#navMain ul li a:hover {background-position:0% -42px;}
#navMain ul li a:hover span {padding:2px 15px 2px 6px;background-position:100% -42px;}


This is what your modified tpl_header.php should look like:
[PHP]<div id="navMain">
<ul>
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><span><?php echo HEADER_TITLE_LOGOFF; ?></span></a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><span><?php echo HEADER_TITLE_LOGIN; ?><span></a></li>
<?php } } ?>

<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><span><?php echo HEADER_TITLE_CART_CONTENTS; ?></span></a></li>
<?php }?>
</ul>
</div>[/PHP]

save your sliding door tableft.gif and tabright.gif to
includes/templates/YOUR_TEMPLATE/images

Attachment #6460
Attachment #6461
12 Sep 2009, 01:30
#18
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Posts:
684
Plugin Contributions:
0

Re: Buttons in main pg header

clydejones:

This is what your css should look like:

#navMain {
	margin:0;
	font-size: 1.1em;
	line-height: normal;
	width: 160px;
	position:absolute;
	top:5px;
	right:5px;
}
#navMain ul {margin:0;padding: 0;display:block;list-style:none;}
#navMain li a {
   padding: 8px 0 0 35px;
	height:24px;
   text-decoration:none;
   background: url(../images/tableft.gif) no-repeat left top;
   color:#000;	
}
#navMain ul li a span {
   display:block;
   background: url(../images/tabright.gif) right top;
   padding:2px 15px 2px 6px;
   }
#navMain ul li a:hover {background-position:0% -42px;}
#navMain ul li a:hover span {padding:2px 15px 2px 6px;background-position:100% -42px;}


This is what your modified tpl_header.php should look like:
[PHP]<div id="navMain">
<ul>
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><span><?php echo HEADER_TITLE_LOGOFF; ?></span></a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><span><?php echo HEADER_TITLE_LOGIN; ?><span></a></li>
<?php } } ?>

<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><span><?php echo HEADER_TITLE_CART_CONTENTS; ?></span></a></li>
<?php }?>
</ul>
</div>[/PHP]

save your sliding door tableft.gif and tabright.gif to
includes/templates/YOUR_TEMPLATE/images

Attachment #6460
Attachment #6461


Hi Clyde,

Been working hard to change two files, but still does not work. Not sure what I am doing wrong.:frusty:
12 Sep 2009, 01:44
#19
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Posts:
7,017
Plugin Contributions:
12

Re: Buttons in main pg header

kburner:

Hi Clyde,

Been working hard to change two files, but still does not work. Not sure what I am doing wrong.:frusty:


Try changing the css with the following:

#navMain ul {margin:0;padding: 0;list-style:none;}
#navMain li a {
padding: 8px 0 0 35px;
display:block;
height:24px;
text-decoration:none;
background: url(../images/tableft.gif) no-repeat left top;
color:#000;
}

You may need to adjust the padding somewhat also.
12 Sep 2009, 02:55
#20
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Posts:
7,017
Plugin Contributions:
12

Re: Buttons in main pg header

clydejones:

Try changing the css with the following:

#navMain ul {margin:0;padding: 0;list-style:none;}
#navMain li a {
padding: 8px 0 0 35px;
display:block;
height:24px;
text-decoration:none;
background: url(../images/tableft.gif) no-repeat left top;
color:#000;
}

You may need to adjust the padding somewhat also.


Don't forget to include the <span> </span> tags.
[PHP]<div id="navMain">
<ul>
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><span><?php echo HEADER_TITLE_LOGOFF; ?></span></a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><span><?php echo HEADER_TITLE_LOGIN; ?></span></a></li>
<?php } } ?>

<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><soan><?php echo HEADER_TITLE_MY_ACCOUNT; ?></span></a></li>

<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><span><?php echo HEADER_TITLE_CART_CONTENTS; ?></span></a></li>
<?php }?>
</ul>
</div>[/PHP]