Topic: my own tpl, how?

How does i create my own tpl and get my page to use it instead of main.tpl

I need to change some in the code that i dont want to be everywhere, so it is only used on my special page

Re: my own tpl, how?

So you want one page (I'll call it newpage.php) to use its own template?

Re: my own tpl, how?

Yes that is exactly what i mean.

Any ideas?

Offcource with punbb footer in the end

Re: my own tpl, how?

Look in header.php

// Load the template
if (defined('PUN_ADMIN_CONSOLE'))
        $tpl_main = file_get_contents(PUN_ROOT.'include/template/admin.tpl');
else if (defined('PUN_HELP'))
        $tpl_main = file_get_contents(PUN_ROOT.'include/template/help.tpl');
else
        $tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl');

You have to add your own if statement (and create a new template) for your new page

5 (edited by lhffan 2006-06-25 09:13)

Re: my own tpl, how?

At work atm guess it will be something similar to this below, and i wonders if i can use
(defined('PUN_GALLERY')) and if i have to specify that somewhere

// Load the template
if (defined('PUN_ADMIN_CONSOLE'))
        $tpl_main = file_get_contents(PUN_ROOT.'include/template/admin.tpl');
else if (defined('PUN_HELP'))
        $tpl_main = file_get_contents(PUN_ROOT.'include/template/help.tpl');
else if (defined('PUN_GALLERY'))
        $tpl_main = file_get_contents(PUN_ROOT.'include/template/gallery.tpl');
else
        $tpl_main = file_get_contents(PUN_ROOT.'include/template/main.tpl');

Re: my own tpl, how?

I think as long as you add

define('PUN_GALLERY', 1);

to whatever this new page is before you include header.php, the code you posted above should work (I may be mistaken though).

Looking for a certain modification for your forum? Please take a look here before posting.