Community Forums

A Note to Theme makers...

Template support & advice for OpenCart v1.x

A Note to Theme makers...

Postby Qphoria » Sun Oct 02, 2011 10:41 pm

I noticed a few theme makers are splitting off the options and other bits into separate tpl files. Then using include/require to include them into the overall page. This is fine but may I ask for a slight change.

The method you use to include them is:
Code: Select all
require 'product_options.tpl';


This causes problems for vQmod scripts that need to alter parts of the page because it uses a relative path to the product.tpl file instead of a relative path to the controller.

please instead use:
Code: Select all
require 'catalog/view/theme/<themename>/template/product/product_options.tpl'


This will resolve the issues.

Current known themes with this issue: shoppica and two other ones I've run into (i forget the names)
Image Image
Donate!|OpenCart Basics|GeoZones
Help me get more development cloud storage - Click Here to get DropBox
User avatar
Qphoria
Administrator
 
Posts: 19015
Joined: Mon Jul 21, 2008 2:02 pm
Donate to Qphoria

Re: A Note to Theme makers...

Postby Johnathan » Mon Oct 03, 2011 8:08 am

Good to know.
Image
ImageImageImageImageImageImageImageImageImage
User avatar
Johnathan
Global Moderator
 
Posts: 3797
Joined: Thu Dec 17, 2009 2:08 pm

Re: A Note to Theme makers...

Postby themeburn » Mon Oct 24, 2011 7:50 am

Qphoria wrote:I noticed a few theme makers are splitting off the options and other bits into separate tpl files. Then using include/require to include them into the overall page. This is fine but may I ask for a slight change.

The method you use to include them is:
Code: Select all
require 'product_options.tpl';


This causes problems for vQmod scripts that need to alter parts of the page because it uses a relative path to the product.tpl file instead of a relative path to the controller.

please instead use:
Code: Select all
require 'catalog/view/theme/<themename>/template/product/product_options.tpl'


This will resolve the issues.

Current known themes with this issue: shoppica and two other ones I've run into (i forget the names)


Thanks for the hint. We will change all of the require statements in our theme, as you suggest.
User avatar
themeburn
 
Posts: 28
Joined: Fri Apr 29, 2011 7:01 am

Re: A Note to Theme makers...

Postby d_koev » Sun Mar 11, 2012 5:34 am

Thanks for the tips, Q! I'll change this too in my themes where it is used.
d_koev
 
Posts: 78
Joined: Thu Jan 14, 2010 7:03 am

Re: A Note to Theme makers...

Postby MarketInSG » Sun Mar 11, 2012 6:26 am

Hmm...noted it :)
User avatar
MarketInSG
 
Posts: 5036
Joined: Tue Nov 15, 2011 10:53 pm
Location: Singapore


Return to Template Support

Who is online

Users browsing this forum: Gareth_gillman and 37 guests

Hosted by Arvixe Web Hosting