Post by hm2k » Wed Mar 12, 2008 10:17 am

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

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by Luvz2drv » Fri Mar 21, 2008 11:00 am

there already is a global for the used template folder

Global Moderator

Posts

Joined
Fri Mar 21, 2008 10:58 am

Post by lev » Thu May 15, 2008 12:37 am

Great Idea, i did this as well, except in the controller for template already has a setting for template used

lev
New member

Posts

Joined
Wed Apr 30, 2008 10:47 pm

Post by hm2k » Wed May 21, 2008 11:19 pm

Luvz2drv wrote: there already is a global for the used template folder
You have a tendency of providing half answers.

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.

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by hm2k » Wed May 21, 2008 11:20 pm

lev wrote: Great Idea, i did this as well, except in the controller for template already has a setting for template used
Details people, details! :)

UK Web Hosting


User avatar
Global Moderator

Posts

Joined
Tue Mar 11, 2008 9:06 am
Location - UK

Post by Luvz2drv » Thu May 22, 2008 3:33 am

hm2k wrote:
lev wrote: Great Idea, i did this as well, except in the controller for template already has a setting for template used
Details people, details! :)
is that all your after is details....  cuz i have lots of details.....      review the code from the setting.php  in the admin section

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

Global Moderator

Posts

Joined
Fri Mar 21, 2008 10:58 am

Post by lev » Tue May 27, 2008 10:29 am

hm2k, in your template files replace the link for your stylesheet to include the template currently used in the path:

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 ;D

lev
New member

Posts

Joined
Wed Apr 30, 2008 10:47 pm
Who is online

Users browsing this forum: No registered users and 1 guest