Change Column Style

A lot of eCommerce websites are starting to do it.

http://www.target.com/LCD-Flat-Panel-TVs-Electronics/b/10775241/ref=sc_fe_l_5_10218751_7?node=10775241

Change column to 3 boxes, list with no images, or list with additional information or just 5 boxes with images and buy now button …

How is it done? JavaScript, PHP, changing CSS styles? all the above?

I have an idea, but i think its a little crazy… 1 php file for 4 Box column, 1 php file for list style, etc…

well based on your example… its exactly what i thought… have a different template / php file that handles the list column.

eCommerce app i’m working with is 100% custom coded. so, which ever approach that makes sense is the way i would like to go.

When I am tasked with type of thing normally I just swap out templates that only build out the list and are injected into the main view. The approach you should take is going to be dependent on the system your working with.

Here is pretty good example of what I mean. My own system supports nested modules. So it would be as simple as changing the one that is being executed given some type of flag.


//... module

$tpl = 'table';

if(strcmp('table',$tpl) == 0) {
     $prod = $this->_app->execute('Product.List.Table');
} else {
    $prod = $this->_app->execute('Product.List.Column');
}

//... template 

<p>Products:</p>

echo $prod;

That probably wouldn’t work for you though.

Like I said its going to be very much based on implementation. Post some code or perhaps just the code used to build the list as its stands in static form.