Default templates?

From: Date: Sun, 13 Jan 2002 09:26:22 +0000
Subject: Default templates?
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2528@lists.php.net to get a copy of this message
Hi, Not a good title, but I couldn't think of anything better :-) Suppose I have the following structure: public_html/
           test/
               foobar/
                     index3.php
               index2.php
           index1.php
templates/
         test/
             foobar/
                   page.tpl
         page.tpl
Now, if in my scripts I call $smarty->display(dirname($PHP_SELF) . "page.tpl"); this works great in index3.php and index1.php. For index2.php there is no corresponding page.tpl, and so what I want is the script to search up the directory tree from this directory until it finds a matching template. This would make my job of writing the application much easier, as I like to organize my templates into he same structure as the htdocs tree, and prefer to set the template_dir to the corresponding directory (meaning I don't need to use dirname($PHP_SELF) each time I fetch a function). Has anyone done anything like this, or can give me advice as to a better way to organize the templates? I was mainly trying to do it so that sections of a site can have different page layout, but without having to remember which layout and code the path to that template. Hopefully it's clear what I'm trying to do :-) Peter. --oOo-- Narrow Gauge on the web - photos, directory and forums! http://www.narrow-gauge.co.uk --oOo-- Peter's web page - Scottish narrow gauge in 009 http://members.aol.com/reywob/ --oOo--

« previous php.smarty.general (#2528) next »