Post by onesixtyfourth » Tue Dec 01, 2009 6:29 pm

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?


Posts

Joined
Mon Nov 30, 2009 8:16 pm

Post by readyman » Tue Dec 01, 2009 11:36 pm

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


User avatar
Global Moderator

Posts

Joined
Wed May 20, 2009 5:16 am
Location - Sydney

Post by onesixtyfourth » Wed Dec 02, 2009 12:09 am

Ok.


Posts

Joined
Mon Nov 30, 2009 8:16 pm

Post by skateyuk » Thu Dec 03, 2009 10:30 pm

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.
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.

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

opencart_example.jpg (65.21 KiB) Viewed 1764 times


Newbie

Posts

Joined
Thu Dec 03, 2009 10:22 pm

Post by fido-x » Thu Dec 03, 2009 10:40 pm

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.
You can use the following instead of the template name (eg. default):-

Code: Select all

<?php $tpl = explode('/', $this->template); echo $tpl[0]; ?>

Image
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!


User avatar
Expert Member

Posts

Joined
Sat Jun 28, 2008 1:09 am
Location - Tasmania, Australia

Post by onesixtyfourth » Fri Dec 04, 2009 12:14 am

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]; ?>
Can I get to the config settings through $this?


Posts

Joined
Mon Nov 30, 2009 8:16 pm

Post by fogelka » Mon Sep 26, 2011 7:12 am

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.

Newbie

Posts

Joined
Mon Sep 26, 2011 6:40 am

Post by uksitebuilder » Mon Sep 26, 2011 6:08 pm

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.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom
Who is online

Users browsing this forum: No registered users and 10 guests