View Single Post
  #2  
Old 03-18-2008, 05:54 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Buttons - Custom image that is

Quote:
Originally Posted by uglysign
I'd like to replace a few buttons and make them images instead.
This button thing was ok for Add to Cart etc found elsewhere on the forums but im having a hell of a time changing the buttons for the following:
  • Login
  • Logout
Would I have to make separate Button_name.tpl file for each of the above with it's own image? Can somebody strip the code down so one can place the appropriate image for each?

I've searched for Custom Buttons and I do not see tons of posts on this.

Anyone?




Anyone care to explain Button.tpl? and why is it so complicated....



You need to edit two files:
skin1/buttons/logout_menu.tpl

PHP Code:
{*{include file="buttons/button.tpl" button_title=$lng.lbl_logoff href="javascript: document.loginform.submit();" js_to_href="Y" image_menu=true type="input"}
*}

<
class="VertMenuItems" href="javascript: document.loginform.submit();">
<
img src="{$ImagesDir}/dingbats_affiliates.gif" alt="{$title|escape}/>
</
a

Where "dingbats_affiliates.gif" image for button "Logout" in dir ("skin1/images")

skin1/buttons/login_menu.tpl

PHP Code:
{*{include file="buttons/button.tpl" button_title=$lng.lbl_log_in href="javascript: document.authform.submit();" js_to_href="Y" image_menu=true type="input"}
*}
<
class="VertMenuItems" href="javascript: document.authform.submit();">
<
img src="{$ImagesDir}/dingbats_affiliates.gif" alt="{$title|escape}/>
</
a
Where "dingbats_affiliates.gif" image for button "Login" in dir ("skin1/images")

You can ask any picture. Change the appropriate code in this example (instead of "dingbats_affiliates.gif")
Reply With Quote