Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Button.tpl is tearing me up!!!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-17-2008, 10:08 AM
 
hhiker hhiker is offline
 

eXpert
  
Join Date: May 2007
Posts: 231
 

Red face Button.tpl is tearing me up!!!

Can someone please break down the file button.tpl to idiot level. I swear, I go cross-eyed every time I look at it. I just want a standard button throughout the site! Well, maybe 2 buttons.

Last time I messed with that file, I broke it a good dozen times and never could figure out how to get it to be what I wanted. Finally left it and just gave up.

Or... does anyone have a better button setup that works?

TIA!!!
__________________
-
-
Versions: 4.1.10 and 4.3.0 (see post for which cart)

"Until man duplicates a blade of grass, nature can laugh at his so-called scientific knowledge." - Thomas Edison

"Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it is the only thing that ever has." - Margaret Mead (1901-197 quoted in John M. RIchardson, ed. Making it Happen, 1982

"Water is the best of all things." - Pindar (c. 522 BC - c. 438 BC), Olympian Odes
Reply With Quote
  #2  
Old 09-18-2008, 12:49 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Button.tpl is tearing me up!!!

Quote:
Originally Posted by hhiker
I just want a standard button throughout the site! Well, maybe 2 buttons.


file - "button/button.tpl"

PHP Code:
....

{if 
$style eq 'button' && ($config.Adaptives.platform ne 'MacPPC' || $config.Adaptives.browser ne 'NN')}

...
Here is a graphical button (but1.gifbut_bg.gifbut2.gif)
If 
set a variable - {$add_style} (but{$add_style}1.gif,  class="Button{$add_style}"but{$add_style}2.gif)
...

{elseif 
$image_menu}

...
Here is a text-link button (with image "go_menu.gif",  class="GoImage")
...

{else}

...
Here is a text-link button (with image "go.gif",  class="GoImage")
 ...

{/if} 


When using a graphical button uses the following construction (for support "If Javascript is enabled in your browser click here" option):

PHP Code:
{if $js_enabled}
        {include 
file="buttons/login_menu.tpl" style="button" button_style="menu"}
{else}
         <
input type="submit" value="{$lng.lbl_log_in|escape}/>
{/if} 
Reply With Quote
  #3  
Old 09-18-2008, 10:18 AM
 
hhiker hhiker is offline
 

eXpert
  
Join Date: May 2007
Posts: 231
 

Default Re: Button.tpl is tearing me up!!!

So I can use simply

<input type="submit" value="{$lng.lbl_log_in|escape}" />

And not have to worry about using the javascript?
__________________
-
-
Versions: 4.1.10 and 4.3.0 (see post for which cart)

"Until man duplicates a blade of grass, nature can laugh at his so-called scientific knowledge." - Thomas Edison

"Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it is the only thing that ever has." - Margaret Mead (1901-197 quoted in John M. RIchardson, ed. Making it Happen, 1982

"Water is the best of all things." - Pindar (c. 522 BC - c. 438 BC), Olympian Odes
Reply With Quote
  #4  
Old 09-18-2008, 01:30 PM
 
Thedae2k Thedae2k is offline
 

eXpert
  
Join Date: Jan 2004
Posts: 288
 

Default Re: Button.tpl is tearing me up!!!

I tend to just make a new button.tpl file with the images that I want. Works great and pretty easy
__________________
X-Cart Pro 4.1.9
PHP5.2.5
MySQL 5.0.54
IIS/Apache/NGINX Webservers
Reply With Quote
  #5  
Old 09-19-2008, 12:17 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Button.tpl is tearing me up!!!

Quote:
Originally Posted by hhiker
So I can use simply

<input type="submit" value="{$lng.lbl_log_in|escape}" />

And not have to worry about using the javascript?


Yes, but not for all the buttons.
Reply With Quote
  #6  
Old 09-19-2008, 07:22 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default Re: Button.tpl is tearing me up!!!

You can try this hack (replace the table based buttons with pure css):

http://forum.x-cart.com/showthread.php?p=162540
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #7  
Old 09-24-2008, 09:18 AM
 
hhiker hhiker is offline
 

eXpert
  
Join Date: May 2007
Posts: 231
 

Default Re: Button.tpl is tearing me up!!!

I really want that darn image button gone! No images! None!

Where are all the images at? Particularly that darn Go button!
__________________
-
-
Versions: 4.1.10 and 4.3.0 (see post for which cart)

"Until man duplicates a blade of grass, nature can laugh at his so-called scientific knowledge." - Thomas Edison

"Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it is the only thing that ever has." - Margaret Mead (1901-197 quoted in John M. RIchardson, ed. Making it Happen, 1982

"Water is the best of all things." - Pindar (c. 522 BC - c. 438 BC), Olympian Odes
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:46 PM.

   

 
X-Cart forums © 2001-2020