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

total newbie - subdirectories structure

 
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 -> General
View previous topic :: View next topic  
Author Message
quali74
Smarty Rookie


Joined: 09 May 2006
Posts: 10

PostPosted: Tue May 09, 2006 5:23 pm    Post subject: total newbie - subdirectories structure Reply with quote

Could somebody tell me how structure a smarty web site having folders.

so far I have:
/index.php
/templates/
/templates_c/
/cache/
/configs/

I want to create a folder called "admin".

Does it mean I have to create
/templates
/templates_c
/cache
/configs
in the 'admin' folder?

cheers
Back to top
View user's profile Send private message
TGKnIght
Smarty Junkie


Joined: 07 Sep 2005
Posts: 580
Location: Philadelphia, PA

PostPosted: Tue May 09, 2006 5:38 pm    Post subject: Reply with quote

You would only need to do so if you want to create seperate set of templates for that sub-dir... otherwise you could just point the subdir to the same template dir.. and perhaps put a subfolder in there Smile

ie. in your admin/index.php

Code:

$smarty->display('admin/admin.tpl');

_________________
Smarty site with one index.php controller file
Working with MySQL and Smarty
SmartyColumnSort
Custom Smarty Javascript Debug Template
Back to top
View user's profile Send private message Visit poster's website
quali74
Smarty Rookie


Joined: 09 May 2006
Posts: 10

PostPosted: Wed May 10, 2006 2:38 pm    Post subject: Reply with quote

it does not work.
I created the following

index.php
admin/page1.php
templates/admin/page1.tpl
templates_c/admin/

and I get :Warning: Smarty error: unable to read resource: "admin/page1.tpl" in D:\www\smarty_quickform\includes\classes\smarty-2.6.13\libs\Smarty.class.php on line 1095

so I changed this to
admin/page1.php
admin/templates/page1.tpl
admin/templates_c

and it works fine but it is not what I really want. How do I get the admin/ templates to call the other templates
Back to top
View user's profile Send private message
nikotto
Smarty Rookie


Joined: 12 Jan 2004
Posts: 26

PostPosted: Wed May 10, 2006 2:54 pm    Post subject: Reply with quote

you can always define the path to your templates, in admin/page1.php you could use
$smarty->template_dir = '../templates/';
Back to top
View user's profile Send private message Send e-mail
quali74
Smarty Rookie


Joined: 09 May 2006
Posts: 10

PostPosted: Wed May 10, 2006 2:57 pm    Post subject: Reply with quote

All the examples and tutorials I can see have no subfolders. Why is that?
I need to understand how a templates folders communicate with each others...
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed May 10, 2006 3:52 pm    Post subject: Reply with quote

Avoid using relative folder paths in your Smarty setup. Instead, use absolute paths that are rooted to your webroot path. Recall, relative file references to /foo/bar.php are different than those to /bar.php -- so if you are using the same code/relative paths, you will NOT be pointing to the same resource locations (eg templates, compiled, cache, config) under both. This has been covered a lot, so perhaps try a search of the forums.

Good luck.
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 -> General 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