I have recently installed Opencart an I quite like it but I am having problems with templates. I have downloaded 1.3.4 which, I think, has changed the way it handles templates. To create myself a template I have copied the default directory from opencart/catalog/view/theme/default and copied it with another name. I then change the template in admin so that my new template is used. I test this by changing the colour of the header image but this change does not show. I eventually find that the stylesheet default is still being used by looking at the link tags in the header. I can change this from the header.tpl file by hardcoding my template name into the link tag but this surely has to be the wrong way to go about it. I have tried to enter $config->get("config_template") and get errors of a non object.
What am I doing wrong here?
What am I doing wrong here?
Just hardcode the template name into the header.tpl file. I may be wrong, but I don't think there is a global template variable available yet.
http://www.alreadymade.com
Follow me on twitter.com/alreadymade
I've done exactly the same thing here, copied the default template over into a new folder, changed the background image etc (simple stuff) and then changed the teplate in the admin settings.onesixtyfourth wrote: To create myself a template I have copied the default directory from opencart/catalog/view/theme/default and copied it with another name. I then change the template in admin so that my new template is used.
Only thing with me is that when I view the template it does not add any styling at all? Just a white screen with the textual content and div boxes.
I've attached a screenshot to see how it looks.
cheers.....
Attachments
opencart_example.jpg (65.21 KiB) Viewed 1764 times
You can use the following instead of the template name (eg. default):-readyman wrote:Just hardcode the template name into the header.tpl file. I may be wrong, but I don't think there is a global template variable available yet.
Code: Select all
<?php $tpl = explode('/', $this->template); echo $tpl[0]; ?>
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Can I get to the config settings through $this?fido-x wrote:[
You can use the following instead of the template name (eg. default):-Code: Select all
<?php $tpl = explode('/', $this->template); echo $tpl[0]; ?>
Hi. New user. Has this issue been fixed yet?
When I choose my revised tempate from the drop-down in Settings >Store >Template, the new CSS does not show on my site. Checking the source code, I see that all of the links have changed to reflect that I'm using the revised template, EXCEPT for the stylesheet link...
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="catalog/view/theme/new_design/stylesheet/slideshow.css" media="screen" />
<link rel="stylesheet" type="text/css" href="catalog/view/theme/new_design/stylesheet/carousel.css" media="screen" />
If the "new_design" stylesheet link has to be hard coded, then it defeats the purpose of the drop-down template selection, doesn't it?
Thanks for the help.
When I choose my revised tempate from the drop-down in Settings >Store >Template, the new CSS does not show on my site. Checking the source code, I see that all of the links have changed to reflect that I'm using the revised template, EXCEPT for the stylesheet link...
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="catalog/view/theme/new_design/stylesheet/slideshow.css" media="screen" />
<link rel="stylesheet" type="text/css" href="catalog/view/theme/new_design/stylesheet/carousel.css" media="screen" />
If the "new_design" stylesheet link has to be hard coded, then it defeats the purpose of the drop-down template selection, doesn't it?
Thanks for the help.
In your new theme folder, there should be a /template/common/header.php file
In side this there should be the link to the stylesheets.css file
This should say something along the lines of:
catalog/view/theme/YOURTHEME/stylesheet/stylesheet.css
If it doesn't and says 'default' instead of 'YOURTHEME' then that is the problem.
In side this there should be the link to the stylesheets.css file
This should say something along the lines of:
catalog/view/theme/YOURTHEME/stylesheet/stylesheet.css
If it doesn't and says 'default' instead of 'YOURTHEME' then that is the problem.
Who is online
Users browsing this forum: No registered users and 10 guests