Nieuw lid |
|
Hallo,
Hoe is het mogelijk om een include functie te maken met TemplatePower? Zelf had ik dit in gedachten.
index.php:
<?php
include_once('template/TemplatePower.inc.php');
$g_tpl = new TemplatePower ( "show.content.tpl" );
$g_tpl->prepare();
$g_tpl->assign ( pagina_titel, "<?PHP-Source.nl" );
if( isset ( $_GET['page'] ) )
{
$page= $_GET['page'];
$final_page= "section.".$page.".tpl";
if( file_exists ( $final_page ) )
{
$g_tpl->newBlock ( "content" );
$g_tpl->assign ( "content", "Included page" );
}
}
else
{
$g_tpl->newBlock ( "content" );
$g_tpl->assign ( "content", "Home" );
}
$g_tpl->printToScreen();
?>
<?php include_once('template/TemplatePower.inc.php'); $g_tpl = new TemplatePower ( "show.content.tpl" ); $g_tpl->prepare(); $g_tpl->assign ( pagina_titel, "<?PHP-Source.nl" ); if( isset ( $_GET['page'] ) ) { $page= $_GET['page']; $final_page= "section.".$page.".tpl"; { $g_tpl->newBlock ( "content" ); $g_tpl->assign ( "content", "Included page" ); } } else { $g_tpl->newBlock ( "content" ); $g_tpl->assign ( "content", "Home" ); } $g_tpl->printToScreen(); ?>
show.content.tpl:
<html>
<head>
<title>{pagina_titel}</title>
</head>
<body>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="122">
<a href="?page=home">HOME</a>
<br />
<a href="?page=links">LINKS</a>
<br />
<a href="?page=contact">CONTACT</a>
</td>
<td width="368" valign="top">
<!-- START BLOCK : content -->
{pagina_content}
<!-- END BLOCK : content -->
</td>
</tr>
</table>
</body>
</html>
<html> <head> <title>{pagina_titel}</title> </head> <body> <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="122"> <a href="?page=home">HOME</a> <br /> <a href="?page=links">LINKS</a> <br /> <a href="?page=contact">CONTACT</a> </td> <td width="368" valign="top"> <!-- START BLOCK : content --> {pagina_content} <!-- END BLOCK : content --> </td> </tr> </table> </body> </html>
Zodat de pagina word ge-include op de plek waar de block content staat. Iemand enig idee hoe ik dit op moet lossen?
|