apply a css class to product loop

General ShopSite user discussion

apply a css class to product loop

Postby tom0360 » Mon Aug 23, 2010 3:16 pm

In a custom template is there a way to apply a css class to a [-- Loop Product --] statement which during generation is converted to a <tr>? So what I would end up with is <tr class="classname">


Thanks,
Thomas
tom0360
 
Posts: 34
Joined: Tue Aug 22, 2006 10:55 am

Re: apply a css class to product loop

Postby mjbrunelle » Tue Aug 24, 2010 8:03 am

We have found that you have to write the style directly in the tag, here is what we do to produce an alernating background color in the row of a table.

Code: Select all

[-- LOOP PRODUCTS --]
     [-- IF VAR.bgColor 0 --]
          <tr style="background: #ffffff">
          [-- VAR.bgColor 1 --]
     [-- ELSE --]
          <tr style="background: #E0E0E0">
          [-- VAR.bgColor 0 --]
     [-- END_IF --]
                         
     <td class="productRow">                                 
          [-- PRODUCT --]
          [-- VAR.idCounter INC --]
          </tr>                         
[-- END_LOOP PRODUCTS --]



MarkB
mjbrunelle
 
Posts: 147
Joined: Sun Jun 21, 2009 5:09 am


Return to User Forum

Who is online

Users browsing this forum: No registered users and 86 guests