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
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 troubleshooting → 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
So you want one page (I'll call it newpage.php) to use its own template?
Yes that is exactly what i mean.
Any ideas?
Offcource with punbb footer in the end
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
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');
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).
PunBB Forums → PunBB 1.2 troubleshooting → my own tpl, how?
Powered by PunBB, supported by Informer Technologies, Inc.