I'd like to propose an effective way to allow store owners set what template file to be associated with each layout. You can see it better in the attached picture but in brief:
- In the Layout edit form should be added a new column with Upload, Download and Restore buttons for mainaining template files.
- Uploaded files with the same name as the default name may rename the existing default file so that to be possible to restore it later if necessary.
- Users will see the file name that is being currently used right before the buttons and will have the ability to change the file. Editing it would be available in Theme Editor section.
Code: Select all
$this->response->setOutput($this->load->view('product/product', $data));
Code: Select all
$this->response->setOutput($this->load->view('product/'.$filename, $data));
Regards!