Post by whitecollar » Sat Sep 26, 2009 6:21 am

Hello, I'm an opencart novice.

I'm trying to make my own template and get it to display.

I've copied the conents of catalog/view/theme/default to catalog/view/theme/MYTHEME

I then changed some basic things with the .css stylesheet in MYTHEME and selected MYTHEME in the admin configuration panel.

But MYTHEME refuses to display ... it just looks like the default template.

I've confirmed my MYTHEME stylesheet changes work by putting it into the catalog/view/theme/default directory.

So I think I am missing some basic step. Please advise ...

Thank you.

New member

Posts

Joined
Wed Sep 09, 2009 10:31 pm

Post by whitecollar » Sat Sep 26, 2009 6:48 am

Ok, I kind of figured it out by myself.

I did a search and replace on every .tpl file in catalog/view/theme/MYTHEME/template/common directory.

I repaced the word "default" with the work "MYTHEME" in every path in the .tpl files.

Is there an easier way to add new themes that manually re-writing the file paths?

Thanks.

New member

Posts

Joined
Wed Sep 09, 2009 10:31 pm

Post by fido-x » Sat Sep 26, 2009 7:57 pm

whitecollar wrote:Ok, I kind of figured it out by myself.

I did a search and replace on every .tpl file in catalog/view/theme/MYTHEME/template/common directory.

I repaced the word "default" with the work "MYTHEME" in every path in the .tpl files.

Is there an easier way to add new themes that manually re-writing the file paths?

Thanks.
You'll need to go through several other files as well since paths to template related images use the same hard-coded path. If you replace your template name with--

Code: Select all

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

Code: Select all

catalog/view/theme/<?php $tpl = explode('/', $this->template); echo $tpl[0]; ?>/whatever
where "whatever" could be "stylesheet" or "image", then your template will then be "transportable".

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
Who is online

Users browsing this forum: No registered users and 7 guests