==Problem Outline==
The problem was if you changed the dir name from "default" to "custom", the inclusion for the tpl files would be incorrect...
ie: in layout.tpl
==Proposed Solution==
OPEN /index.php
FIND:
// Template
$template =& $locator->get('template');
ADD:
// Catalog Template
$template->set('template', $template->directory);
OPEN layout.tpl
FIND:
REPLACE WITH:
/css/default.css">
Now, we need to do this for each template that calls a css file.
OPEN EACH controller file in /catalog/controller/:
FIND:
$view = $this->locator->create('template');
ADD:
$view->set('template', $template->directory);
...OR... if you want to set a global variable...
OPEN /library/template/template.php
FIND:
$this->directory = $directory;
ADD:
$this->data['template'] = $directory;
OPEN *.tpl
MASS REPLACE
The problem was if you changed the dir name from "default" to "custom", the inclusion for the tpl files would be incorrect...
ie: in layout.tpl
==Proposed Solution==
OPEN /index.php
FIND:
// Template
$template =& $locator->get('template');
ADD:
// Catalog Template
$template->set('template', $template->directory);
OPEN layout.tpl
FIND:
REPLACE WITH:
/css/default.css">
Now, we need to do this for each template that calls a css file.
OPEN EACH controller file in /catalog/controller/:
FIND:
$view = $this->locator->create('template');
ADD:
$view->set('template', $template->directory);
...OR... if you want to set a global variable...
OPEN /library/template/template.php
FIND:
$this->directory = $directory;
ADD:
$this->data['template'] = $directory;
OPEN *.tpl
MASS REPLACE
You have a tendency of providing half answers.Luvz2drv wrote: there already is a global for the used template folder
Try providing me with details of the name of this global that already exists.
In future, please try and provide details with all of your replies.
Thanks.
Details people, details!lev wrote: Great Idea, i did this as well, except in the controller for template already has a setting for template used

is that all your after is details.... cuz i have lots of details..... review the code from the setting.php in the admin sectionhm2k wrote:Details people, details!lev wrote: Great Idea, i did this as well, except in the controller for template already has a setting for template used![]()
that will show you what and where -- and how to get at it...
// Detials i pick to provide are just that my choice... as i had to learn i provide enough for other to go learn too i not one to spoon feed the group... the coding is php - i under stand no all can read/understand & modify it... but that is why there is option like search -> google - lots of help out there on basics to see .... and well if that fails.. read thru the code slowly till you find an example of what you want to .... not that hard..
php errors are not specific to opencart... -> php.net and many others...
apache settings.. -- well the list is there
sites for support on the platforms the software run on are good for there support tooo and examples of setups specific to there SOFTWARE they provide....
now -- you are a mod... start mod ing ppl and guiding and put there post in the correct spot... if you want to make a request of me that is my request of you... police ppl to post in the correct form area and to try a search... not pull up dead topics like 60+ days old
now everone have a great day
hm2k, in your template files replace the link for your stylesheet to include the template currently used in the path:
if you notice in your library/template/template.php class, the constructor recieves a parameter of the directory and stores to a local variable called directory. we are simply retrieving this value.
Hope that helps
Code: Select all
<link rel="stylesheet" type="text/css" href="catalog/template/<?php echo $this->directory; ?>/css/account_forgotten.css">
if you notice in your library/template/template.php class, the constructor recieves a parameter of the directory and stores to a local variable called directory. we are simply retrieving this value.
Hope that helps

Who is online
Users browsing this forum: No registered users and 1 guest