Re: different template paths
| From: | Monte Ohrt | Date: | Tue, 17 Jul 2001 13:22:50 +0000 |
| Subject: | Re: different template paths | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1179@lists.php.net to get a copy of this message | ||
Use the full path to the included templates, or you could pass your
template path in an assigned variable:
assign("moda","/path/to/Module_A");
assign("modb","/path/to/Module_B");
{include file="$moda/index.tpl"}
{include file="$modb/index.tpl"}
I've also tossed around the idea of allowing $template_dir to be an
associative array, to assign multiple template resources:
$template_dir = array(
"moda","/path/to/module_A",
"modb","/path/to/module_B",
"gen","/path/to/General");
{include path="moda:index.tpl"}
Marc Logemann wrote:
>
> Hi,
>
> i have an application which has several template directories, depending
> on the area of the application where you are in.
>
> thats no problem, because i modify the template path. But i have
> some templates which are in a general template path, because they
> will be included in other templates.
>
> My problem is the include(). These general templates do not reside in
> the same directory as the actual content templates, and so smarty
> will not find them.
>
> Here is my tree:
>
> application
> |
> |--- Module_A
> | |
> | |- Templates
> |
> |
> |--- Module_B
> | |
> | |- Templates
> |
> |
> |--- General
> |
> |- Templates
>
> So a template which reside in module_a/templates will include
> a template which reside in general/templates
>
> How can i achieve this?
>
> thx for info
>
> -----------------------
> Marc Logemann
> Morelogs GmbH & Co. KG
> Chief Software Architect
> -----------------------
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/