| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
#1
|
|||||||
|
|||||||
![]() Hi
I need some help on the correct sequence to create a new button that will be different from all the other buttons on my site (larger and a different background colour). I belive the buttons are made up of three images which automatically self adjust to suit the text in the button, this process i wish to keep. I have made three new images in Photoshop (LH/midd/RH button image) which i have uploaded to skin1/images. Do i now need to make a new style in skin1.css for example call the new style "Button1" then add all the style data below, then in the product.tpl rename the style that i require to be displayed, for example this is the original line of code in the product.tpl of the button i wish to change </td> <td><div align="centre">{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}</div></td> </tr> Where the style is in red above is where i would put "Button1" the new style that i created. Is this the correct way to do this and if i require more different button colours etc then i would repeat the above.
__________________
4.1.11 gold x-special offers CDSEO Pro |
|||||||
#2
|
|||||||||
|
|||||||||
![]() Also you should change your buttons/button.tpl
Code:
to Code:
__________________
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 |
|||||||||
#3
|
|||||||
|
|||||||
![]() By changing the buttons/button.tpl as you suggested will do what to the button?
Please excuse my ignorance as i am a begginer, lol.
__________________
4.1.11 gold x-special offers CDSEO Pro |
|||||||
#4
|
|||||||||
|
|||||||||
![]() button.tpl produces buttons of specified style
There is style 'button' but no 'button1'. If you specify style 'button1' condition if $style eq 'button' will be false and button of default style is produced (simple text link I guess) so I added elseif $style eq 'button1' where you can specify your custom style used when button.tpl is invoked with $style="button1"
__________________
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 |
|||||||||
#5
|
|||||||
|
|||||||
![]() Thanks Victor D
So every time i create a new button i have to add code to the buttons/button.tpl as your example, would this be for any type of button that i change? Copy of your code below with the code in red which relates to the new button css and img's for that button, is this the only .tpl that has to be changed when applying a new button? {elseif $style eq 'button1' && ($config.Adaptives.platform ne 'MacPPC' || $config.Adaptives.browser ne 'NN')} <table cellspacing="0" cellpadding="0" onclick="{$js_link}" class="Button1Table"{if $title ne ''} title="{$title|escape}"{/if}> {strip} <tr> <td> <{$img_type} src="{$ImagesDir}/LH.gif" class="Button1Side" alt="{$title|escape}" /> </td> <td class="Button1"{$reading_direction_tag}> <font class="Button1">{$button_title}</font> </td> <td> <img src="{$ImagesDir}/RH.gif" class="Button1Side" alt="{$title|escape}" /> </td> </tr> {/strip} </table> I have the new button on my site without the change to the buttons/button.tpl and it is working fine but i assume that to be fully correct i have to change the /button.tpl One more thing, where is the reference to the midd img?
__________________
4.1.11 gold x-special offers CDSEO Pro |
|||||||
#6
|
|||||||||
|
|||||||||
![]() If you need more than one custom button you can do it like this
Code:
Now you should apply custom styles: Code:
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:
If you include button.tpl directly this tpl is the only one. Quote:
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 |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|