Thread: button graphics
View Single Post
  #26  
Old 12-20-2007, 10:48 AM
  inboxnews's Avatar 
inboxnews inboxnews is offline
 

Senior Member
  
Join Date: Jul 2007
Posts: 121
 

Default Re: button graphics

Quote:
Originally Posted by gb2world
I have not done exactly what you are trying to do, I've only added a couple of button styles - so I can't give you precise directions, but maybe this will help. You will have to experiment.

The button.tpl is shared - you will see many instances of buttons that use button.tpl (that does not suck - it is shared code - more efficient, hopefully) - so if you are going to make changes in there for only certain buttons, you need to use {if} based on the variables you pass in with the include from the originating file (product.tpl in your case). Perhaps you could set the $style or the $button_title and/or other variables to something. You can figure out how xcart is using those variables, then modify their code, or do your own thing with an {if}.

in product.tpl:
{include file="buttons/button.tpl" button_title=$lng.lbl_pconf_add_to_configuration style="MY_HAPPY_BUTTON" href="javascript:if (FormValidation()) `$ldelim`document.orderform.productid.value='`$sma rty.get.pconf`';document.orderform.action='pconf.p hp';document.orderform.submit()`$rdelim`" style="MY_HAPPY_BUTTON_STYLE" button_style="WHATEVER_I_WANT"}

Then, in button.tpl:
{if $button_style eq "WHATEVER_I_WANT"}
do cool stuff
{/if}

etc.

If this works - you can replace what they did with non-sliced buttons, or css or whatever you need. If it works - post back - I may want to duplicate it!


If that is too complex, have you tried just replacing the include for button.tpl in product.tpl to use your button code instead? Look at what that call to button.tpl would have included in product.tpl, and replace it with your code.

Thanks gb2. You're definately on to something, unfortunately for me, the 'if' statement wont work here. since the 'if' statement is already used. It needs to be an 'else' statement instead. I've tried some stuff but failed so far. I'll post my success should that happen.
__________________
XCART 4.1.8 [Linux]
Reply With Quote