Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

How to change buttons in header to text links?


27 replies to this topic

#1 pberry4032

  • Community Member
  • 9 posts
  • Real Name:Paul Berry

Posted 20 November 2010, 23:49

with 2.3.1 the header links are now buttons but I want to revert mine to text links with a small icon to the left of the link if possible.

Can anyone help, been trying all night to no avail!

Thanks.

#2 www.in.no

  • Community Member
  • 235 posts
  • Real Name:Arild Evensen

Posted 21 November 2010, 09:01

Have not change it on 2.3.1 but it is in the include/header.php you have to remove the tep_draw_button function and add images and text insted.

It is just in the start of the file, the 3 buttons and a few line down you have the logg off button if logged inn.

#3 burt

  • Community Sponsor
  • 6,970 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 21 November 2010, 12:36

Exactly the same as before mate;

echo tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

would be



echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>';
The Dirty Little Secrets that no osCommerce template sellers want you to know...revealed...

Support is commercially available. The question is whether you value your business
highly enough to spend money on it.

For commercial support from known developers who support osCommerce
ethos, please post at http://forums.oscommerce.com/forum/79-commercial-support/

#4 pberry4032

  • Community Member
  • 9 posts
  • Real Name:Paul Berry

Posted 21 November 2010, 12:47

Cheers G.

It was how to re-arrange the link with the . ( ' and " in the right place that was getting me stuck.

#5 pberry4032

  • Community Member
  • 9 posts
  • Real Name:Paul Berry

Posted 21 November 2010, 13:04

Actually, still a little confused.

I've now got this:

'<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>',
       '<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . HEADER_TITLE_CART_CONTENTS . '</a>',
       '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . HEADER_TITLE_CHECKOUT . '</a>',

but it still draws buttons so my guess is it's been created with css. I couldn't find it with a quick glance but will have a better look once he washing up's done!

Edited by pberry4032, 21 November 2010, 13:06.


#6 burt

  • Community Sponsor
  • 6,970 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 21 November 2010, 13:27

If you have the link still inside the headerShortcuts div you'll also need to remove this;

<script type="text/javascript">
  $("#headerShortcuts").buttonset();
</script>

Or rename the div.
The Dirty Little Secrets that no osCommerce template sellers want you to know...revealed...

Support is commercially available. The question is whether you value your business
highly enough to spend money on it.

For commercial support from known developers who support osCommerce
ethos, please post at http://forums.oscommerce.com/forum/79-commercial-support/

#7 pberry4032

  • Community Member
  • 9 posts
  • Real Name:Paul Berry

Posted 21 November 2010, 14:02

You da man G!

Cheers. That would have had me going for ages!

#8 ZwenZwenzzon

  • Community Member
  • 7 posts
  • Real Name:Zwen

Posted 02 December 2010, 09:44

Exellent tutoring guys :thumbsup:

That solved my button customization confusion.

What's the point with those tep_draw_button thangs when a simple class in the main stylesheet can do it as well?

#9 ZwenZwenzzon

  • Community Member
  • 7 posts
  • Real Name:Zwen

Posted 02 December 2010, 21:09

Ok, an other tricky one I ran into from the product_info.php page:

<span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span>

How to replace that one with an ordinary text link? (and eventually a GIF icon)

#10 ZwenZwenzzon

  • Community Member
  • 7 posts
  • Real Name:Zwen

Posted 03 December 2010, 07:39

View Postpberry4032, on 20 November 2010, 23:49, said:

with 2.3.1 the header links are now buttons but I want to revert mine to text links with a small icon to the left of the link if possible.

Can anyone help, been trying all night to no avail!

Thanks.

Here is my contribution to the header shortcut block:

    <div id="headerShortcuts">
<?php 
  echo '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" alt="" >' .($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : '') . HEADER_TITLE_CART_CONTENTS . '</a>' .
         '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" alt="" >' . HEADER_TITLE_CHECKOUT . '</a>' .
         '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '" alt="" >' . HEADER_TITLE_MY_ACCOUNT . '</a>';

  if (tep_session_is_registered('customer_id')) {
    echo  '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '" alt="" >' . HEADER_TITLE_LOGOFF . '</a>';
  }
?>
   </div>

and some css to begin with:

.headerShortcutLink {
background: #2b5b2b url(icon.gif);
border: 2px solid black;
color:white;
padding: 8px;
margin-right:3px;
}

Don't forget to remove the JavaScript BS too as burt told.

----------------------------------------------------

I'm still trying to solve my previous question to remove tep_draw_hidden_field. Somebody knows how to?

#11 blr044

  • Community Member
  • 1,009 posts
  • Real Name:Bennett
  • Gender:Male
  • Location:USA

Posted 25 January 2011, 00:21

Have no reason why or what happen. Up to today, the navigation in header for account and etc. were buttons. Today they are as text links. The header has not been changed for except I added a create account button/link. Below is the section of header.php file:

<div id="header" class="grid_24">
  <div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div>

  <div id="headerShortcuts">
<?php
  echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .
       tep_draw_button(HEADER_TITLE_CREATE_ACCOUNT, 'person', tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')) .
       tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .
       tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

  if (tep_session_is_registered('customer_id')) {
    echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
  }
?>
  </div>

<script type="text/javascript">
  $("#headerShortcuts").buttonset();
</script>
</div>

Class headerShortcuts is still in the stylesheet and it isn't commented out. So am wondering if this has happen to anyone else and what might I have to look at to resolve this issue?

Thanks.

Bennett

Edited by blr044, 25 January 2011, 00:23.


#12 blr044

  • Community Member
  • 1,009 posts
  • Real Name:Bennett
  • Gender:Male
  • Location:USA

Posted 25 January 2011, 05:16

View Postblr044, on 25 January 2011, 00:21, said:

Have no reason why or what happen. Up to today, the navigation in header for account and etc. were buttons. Today they are as text links. The header has not been changed for except I added a create account button/link.[/code]

Wasn't sure if this was the right place to place this posting. But found the error. When I downloaded a new theme fromThemeroller, I noticed it comes with jquery-ui-1.8.9.custom.css. As I have learned, jquery-ui-1.8.9.custom.css, needs to renamed as jquery-ui-1.8.9.css. But somehow I renamed ext/jquery/ui/jquery-ui-1.8.6.min.js of includes/template_top.php to ext/jquery/ui/jquery-ui-1.8.9.min.js

#13 carver

  • Community Member
  • 9 posts
  • Real Name:Cindy Carver

Posted 08 March 2011, 16:49

I have used the code suggested. It moved the text links to the upper left hand corner. My first choice would have the text links on the right hand side IN THE header bar, second choice would be immediately above the header bar.

When I search for this, the search replies I am using html tags which I'm not.

Thank you for your help.
Carver

#14 Juzzyman

  • Community Member
  • 72 posts
  • Real Name:Justin
  • Gender:Male
  • Location:Canada

Posted 24 March 2011, 03:56

View Postburt, on 21 November 2010, 13:27, said:

If you have the link still inside the headerShortcuts div you'll also need to remove this;

<script type="text/javascript">
  $("#headerShortcuts").buttonset();
</script>

Or rename the div.
I have followed these instructions and managed to change the tabs to text but they are all right next to each other. So no spaces, how do I create a space between the words or add a vertical line to break them up or something?

#15 wildvettes

  • Community Member
  • 81 posts
  • Real Name:Damien Routledge

Posted 24 March 2011, 07:09

View PostJuzzyman, on 24 March 2011, 03:56, said:

I have followed these instructions and managed to change the tabs to text but they are all right next to each other. So no spaces, how do I create a space between the words or add a vertical line to break them up or something?


I suck at coding and I'm barely learning, but this will be what you'll want yours to look like to do what you are describing... :) Glad I could actually help someone.

<div class="grid_24 ui-widget infoBoxContainer">
<div class="ui-widget-header infoBoxHeading">

<?php echo '&nbsp;&nbsp;' . $breadcrumb->trail(' &raquo; '); ?>

<div style="width:50%;float:right;text-align:right;padding-right:10px;">

<?php
echo '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" alt="" >' .($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : '') . HEADER_TITLE_CART_CONTENTS . '</a>'. '&nbsp;'.'&raquo;'.'&nbsp;'.
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" alt="" >' . HEADER_TITLE_CHECKOUT . '</a>' .'&nbsp;'.'&raquo;'.'&nbsp;'.
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '" alt="" >' . HEADER_TITLE_MY_ACCOUNT . '</a>';

if (tep_session_is_registered('customer_id')) {
echo '&nbsp;'.'&raquo;'.'&nbsp;'.'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '" alt="" >' . HEADER_TITLE_LOGOFF . '</a>';
}
?>
</div>
</div>
</div>

#16 Juzzyman

  • Community Member
  • 72 posts
  • Real Name:Justin
  • Gender:Male
  • Location:Canada

Posted 24 March 2011, 13:12

View Postwildvettes, on 24 March 2011, 07:09, said:

I suck at coding and I'm barely learning, but this will be what you'll want yours to look like to do what you are describing... :) Glad I could actually help someone.

<div class="grid_24 ui-widget infoBoxContainer">
<div class="ui-widget-header infoBoxHeading">

<?php echo '&nbsp;&nbsp;' . $breadcrumb->trail(' &raquo; '); ?>

<div style="width:50%;float:right;text-align:right;padding-right:10px;">

<?php
echo '<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_SHOPPING_CART) . '" alt="" >' .($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : '') . HEADER_TITLE_CART_CONTENTS . '</a>'. '&nbsp;'.'&raquo;'.'&nbsp;'.
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" alt="" >' . HEADER_TITLE_CHECKOUT . '</a>' .'&nbsp;'.'&raquo;'.'&nbsp;'.
'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '" alt="" >' . HEADER_TITLE_MY_ACCOUNT . '</a>';

if (tep_session_is_registered('customer_id')) {
echo '&nbsp;'.'&raquo;'.'&nbsp;'.'<a class="headerShortcutLink" href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '" alt="" >' . HEADER_TITLE_LOGOFF . '</a>';
}
?>
</div>
</div>
</div>
You are an absolute LEGEND!!! Thanks so much for that!!!

#17 wildvettes

  • Community Member
  • 81 posts
  • Real Name:Damien Routledge

Posted 24 March 2011, 14:40

View PostJuzzyman, on 24 March 2011, 13:12, said:

You are an absolute LEGEND!!! Thanks so much for that!!!

Not a problem. :D

#18 AdamBarker

  • Community Member
  • 2 posts
  • Real Name:Adam

Posted 24 March 2011, 16:08

May I first of all apologize for my blatant thread hijack, not being aware of any nomenclature associated with these buttons, I came to the first thread to mention an issue with them.

My problem is not getting the button's to operate as text but to have them working in the first place.


My Code Snippet
Is as standard

<div id="header" class="grid_24">
<div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div>

<div id="headerShortcuts">
<?php
echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .
tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .
tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

if (tep_session_is_registered('customer_id')) {
echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
}
?>
</div>

<script type="text/javascript">
$("#headerShortcuts").buttonset();
</script>
</div>

Yet the buttons simply do not function could someone point me in the right direction :) or supply link to more suitable thread :)

I am thinking this is an sql issue.....

Edited by AdamBarker, 24 March 2011, 16:10.


#19 AdamBarker

  • Community Member
  • 2 posts
  • Real Name:Adam

Posted 24 March 2011, 17:17

View PostAdamBarker, on 24 March 2011, 16:08, said:

May I first of all apologize for my blatant thread hijack, not being aware of any nomenclature associated with these buttons, I came to the first thread to mention an issue with them.

My problem is not getting the button's to operate as text but to have them working in the first place.


My Code Snippet
Is as standard

<div id="header" class="grid_24">
<div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div>

<div id="headerShortcuts">
<?php
echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart->count_contents() > 0 ? ' (' . $cart->count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .
tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .
tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

if (tep_session_is_registered('customer_id')) {
echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
}
?>
</div>

<script type="text/javascript">
$("#headerShortcuts").buttonset();
</script>
</div>

Yet the buttons simply do not function could someone point me in the right direction :) or supply link to more suitable thread :)

I am thinking this is an sql issue.....


Having done some further testing it would appear that the header shortcuts work whilst not logged in or whilst the cart is empty, they will not work once thee cart has items in.

Am I alone in these issues?

#20 Juzzyman

  • Community Member
  • 72 posts
  • Real Name:Justin
  • Gender:Male
  • Location:Canada

Posted 24 March 2011, 17:36

View PostAdamBarker, on 24 March 2011, 17:17, said:

Having done some further testing it would appear that the header shortcuts work whilst not logged in or whilst the cart is empty, they will not work once thee cart has items in.

Am I alone in these issues?
I think so. I have just checked my site, although still in development and all my buttons work. Whether the cart is empty or has stuff in it.

I am using version 2.3.1,you?

I think click on the "start new topic" button and go and ask in the "General Support" section. You may have more chance of getting the reply you need. Sorry I can't be of more assistance. I'm a newbie!