Page 1 of 1

Are includes possible in OC ??

Posted: Thu Apr 11, 2013 3:50 pm
by justinesmithies
I have the same code in the start of all my controller / language / tpl files and i was wondering is there a way to save size to use an include so its all in 3 files to be included controller / lang / tpl in the files above , Thus saving on file size ???

I hope someone knows what i mean ?

any help would be appreciated.

Re: Are includes possible in OC ??

Posted: Thu Apr 11, 2013 10:00 pm
by Johnathan
Yes, you can just use a PHP statement in the template file to include another .tpl file. For example:

Code: Select all

<?php include('catalog/view/theme/default/template/product/layout.tpl'); ?>
Then you'd use that in place of the product code. Keep in mind that different controllers use different variables, however, and if you use vQmods then they won't affect the included file (without some adjustment).