PDA

View Full Version : Organising my site layout


onefix
05-26-2007, 02:52 PM
I have just started a full list of cornish villages and towns (http://www.cornish.co.uk/cornwall-towns-villages.php) and would like to organize things.
At the moment if I add a village I have to add e.g stagnes.php to the root folder /
Then add stagnes.tpl to /templates/net blue/

I would like to organize it so I could make a directory in my templates folder called /templates/towns-villages/
I am unsure what I need to change in : stagnes.php and anywhere else?
Content visible to registered users only.Ive tried changing //make outup ....fetch('/towns-villages/stagens.tpl');

Anybody got any ideas? Thanks

James
05-26-2007, 10:58 PM
to do it the way you are trying would be to put the towns-villages folder inside the template folder you are using ....

or

now this is off the top of my head so dont hold me to it....

add
$add_tpl = 'towns-villages');
$tpl2 = get_tpl($add_tpl);

at the end of the init.tpl right before
?>

then

in stagnes php try
//Make output
echo $tpl2->fetch('stagens.tpl');

onefix
05-27-2007, 11:59 AM
Thanks for help dawzz but just comes up with errors when I try and add:
Content visible to registered users only.

to my init.php file (couldn't find a init.tpl file?)

I've added "towns-villages" directory to my template folder.

James
05-28-2007, 01:03 AM
remove the add from the second line ......


I will play with that in a bit myself am curious if that works or not because if it does it opens a whole new door of portability when changing themes etc

onefix
05-28-2007, 02:35 PM
maybe getting closer?

still doesn't display correct page....also at top of page I get:

Warning: Smarty error: unable to read resource: "..//messages.tpl" in /home/onefix/public_html/libs/smarty/Smarty.class.php on line 1095

Ive added into init.php:
Content visible to registered users only.and into stagnes.php:
Content visible to registered users only.still no joy