Thread: New Button
View Single Post
  #6  
Old 06-30-2009, 01:14 PM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: New Button

If you need more than one custom button you can do it like this
Code:
{elseif $style eq 'button1' && ($config.Adaptives.platform ne 'MacPPC' || $config.Adaptives.browser ne 'NN')} <table cellspacing="0" cellpadding="0" onclick="{$js_link}" class="{$custom_class}"{if $title ne ''} title="{$title|escape}"{/if}> {strip} <tr> <td> <{$img_type} src="{$ImagesDir}/spacer.gif" class="{$custom_class}-l" alt="{$title|escape}" /> </td> <td class="{$custom_class}"{$reading_direction_tag}> <font class="{$custom_class}">{$button_title}</font> </td> <td> <img src="{$ImagesDir}/spacer.gif" class="{$custom_class}-r" alt="{$title|escape}" /> </td> </tr> {/strip} </table>



Now you should apply custom styles:
Code:
/*FirstButton*/ TABLE.FirstButton{ /*common first button styles*/ } img.FirstButton-l{ /*left part of the first button styles*/ } img.FirstButton-r{ /*right part of the first button styles*/ } TD.FirstButton{ /*center part of the first button styles*/ } /*SecondButton*/ TABLE.SecondButton{ /*common second button styles*/ } img.SecondButton-l{ /*left part of the second button styles*/ } img.SecondButton-r{ /*right part of the second button styles*/ } TD.SecondButton{ /*center part of the second button styles*/ } .... /*TheVeryLastButton*/ TABLE.TheVeryLastButton{ ....

Now you can include button.tpl as
{include file='button.tpl'.... style='button1' custom_class="FirstButton"}
{include file='button.tpl'.... style='button1' custom_class="SecondButton"}
....
{...}

Quote:
is this the only .tpl that has to be changed when applying a new button?

If you include button.tpl directly this tpl is the only one.

Quote:
One more thing, where is the reference to the midd img?
in CSS TD.button1 should be like this

TD.button1{
background: #fff url(images/btn-c.gif) left top repeat-x;
}
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote