Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

cant figure out why tempalte wont load

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
dmllc
Smarty Rookie


Joined: 15 Oct 2010
Posts: 6

PostPosted: Fri Oct 15, 2010 7:58 pm    Post subject: cant figure out why tempalte wont load Reply with quote

im a smarty noob. this is the first site ive developed using smarty so be easy.

ive installed smarty on my web server and can create a new smarty object. however when i try to render a template i get the following error:

<b>Fatal error</b>: Uncaught exception 'SmartyException' with message 'Unable to load template file 'index.tpl'' in /lib/Smarty-3.0rc4/libs/sysplugins/smarty_internal_template.php:174
Stack trace:
#0 /lib/Smarty-3.0rc4/libs/sysplugins/smarty_internal_template.php(551): Smarty_Internal_Template-&gt;isExisting(true)
#1 /lib/Smarty-3.0rc4/libs/Smarty.class.php(328): Smarty_Internal_Template-&gt;getRenderedTemplate()
#2 /lib/Smarty-3.0rc4/libs/Smarty.class.php(370): Smarty-&gt;fetch('index.tpl', NULL, NULL, NULL, true)
#3 /sites/clients/DigitalMedia/digitalmedia-llc_net/v3_0/httpfiles/index.php(21): Smarty-&gt;display('index.tpl')
#4 {main}
thrown in <b>/lib/Smarty-3.0rc4/libs/sysplugins/smarty_internal_template.php</b> on line <b>174</b>

this is where it's erroring:

public function isExisting ($error = false)
169 {
170 if ($this->isExisting === null) {
171 $this->isExisting = $this->resource_object->isExisting($this);
172 }
173 if (!$this->isExisting && $error) {
174 throw new SmartyException("Unable to load template {$this->resource_type} '{$this->resource_name}'");
175 }
176 return $this->isExisting;
177 }


i'm not sure how to resolve this error. here is my source code:

require_once("../php/global/constants.php");
require_once(SMARTY_DIR . "Smarty.class.php");

$smarty = new Smarty();

$smarty->template_dir = "/htdocs/clients/DigitalMedia/v3_0/templates/";
$smarty->compile_dir = "/htdocs/clients/DigitalMedia/v3_0/templates_c/";
$smarty->config_dir = "/htdocs/clients/DigitalMedia/v3_0/configs/";
$smarty->cache_dir = "/htdocs/clients/DigitalMedia/v3_0/cache/";
$smarty->debugging = true;

$smarty->assign("tagTitle",SITE_NAME);


$smarty->display('index.tpl');
Back to top
View user's profile Send private message
highryse
Smarty Rookie


Joined: 16 Dec 2010
Posts: 25

PostPosted: Thu Dec 16, 2010 11:39 am    Post subject: Reply with quote

hey there - sorry I can't help but basically I have the same problem - did you ever resolve it?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Dec 16, 2010 3:07 pm    Post subject: Reply with quote

Does this directory exist?

/htdocs/clients/DigitalMedia/v3_0/templates/

Does this file exists, and readable by PHP?

/htdocs/clients/DigitalMedia/v3_0/templates/index.tpl

check those first.
Back to top
View user's profile Send private message Visit poster's website
bigking
Smarty n00b


Joined: 16 Jun 2012
Posts: 1

PostPosted: Sun Jun 17, 2012 6:33 am    Post subject: Reply with quote

I'm having the same problem how to fix it?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Jun 17, 2012 8:21 am    Post subject: Reply with quote

Insert $smarty->testInstall(); in your script after you have configured the folders.

It will produce some output if the folders are accessable.
Back to top
View user's profile Send private message
sasajib
Smarty n00b


Joined: 01 Oct 2012
Posts: 1

PostPosted: Mon Oct 01, 2012 6:22 pm    Post subject: Reply with quote

test your smarty installation

$smarty->testInstall();exit;

if template/other directory not found you can use " SMARTY_DIR " constant for full path
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP