product template- select single column layout?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Is there a recommended way to modify the product template (new with 2.1) so it can use the single column layout instead of two column? I have some products I want to use this template, while others will use the default one (which uses the two column).
12 years ago
hmm... I haven't found an easy way to achieve it.

The hard way is to modify CatalogController ('Product' and 'AddToCartProduct' methods). Return appropriate view from controller. For example, instead of
"return View(model)" write "return View(ProductModel.ProductTemplateViewPath, model)". In this case you don't need Product.cshtml file and you can set 'Layout' property in a template file.
12 years ago
Thanks for the input. I put a hack in place with a new product.cshtml to check if the partial name contained some keyword im looking for, and have it toggle the layout according. Not a "real" solution but will get us out the door.
12 years ago
boomhauer wrote:
Not a "real" solution but will get us out the door.

Agree. I've just updated product templates implementation according to my previous post. Please see changeset 3fd8acc27ecc
12 years ago
ah that makes sense, move it back into the controller. thanks, ill integrate this changeset.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.