Ritesh
Ritesh

Reputation: 81

override 1column.phtml file in magento

I am working on multi store magento setup. I used conditional statement for specific view in particular store in 1column.phtml file.I override the local.xml file also its worked for me,but i want separate 1column.phtml file for each store.

Upvotes: 2

Views: 469

Answers (4)

Ritesh
Ritesh

Reputation: 81

We can do this by FallBack mechanism as Blastfreak suggest me. My folder structure is:- app/design/frontend/stores/store1/template/page/1column.phtml

stores is my package store1 is my theme

And i set Current Package Name = stores in admin panel. And Edit my CMS home-page ->Click on design tab->go to Custom Design->select custom theme to store1 under store package. Thats it.

Upvotes: 0

Darth Egregious
Darth Egregious

Reputation: 20106

The cleanest solution is to change which template is loaded in the controller based on the store id.

if ($storeId == 2) {
  $this->getLayout()->getBlock($oneColumnBlock)->setTemplate($yourCustomTemplate);
}

Upvotes: 0

Ian Ramandika
Ian Ramandika

Reputation: 89

you need to try manual action where need your store id with this code

<?php if (Mage::app()->getStore()->getStoreId() == 9): ?>

'9' is your store ID (just for example) it's work for me. so you can test and let me know if problem :)

Upvotes: 1

Mihir Bhende
Mihir Bhende

Reputation: 9055

I believe what you can do is have different themes for each store, each theme will have just one folder inside template/page/1column.phtml, and use other functionalities using fallback mechanism.

Upvotes: 3

Related Questions