I am trying to have a template based site and wan't to have a layout.php page which includes the majority of html, formatting, etc. and then content pages which include the variables. I have everything working but when I try to have a variable that has an include function it returns the included file at the top of the resulting webpage rather than in the spot where the variable resides. Here is the code:
Content Code
Code: Select all
<?php
//this is a the content page that uses the Template class
require_once "Template.class"; //Include the class
$page = new HtmlTemplate ("layout.php"); //create an instance
$page->SetParameter("PAGE_TITLE","This is the title");
$sub = '<td class="graybodyBold">THE COURSE</td>';
$nav = '<a href="1.php">ONE</a><a href="2.php">TWO</a>';
$content = '<td class="text">Some body copy.</td>';
$menu = include("menu.php");
$page->SetParameter ("SUB_TITLE", $sub); //set the subtitle
$page->SetParameter ("PAGE_CONTENT", $content); //set the content
$page->SetParameter ("NAVIGATION_LINKS", $nav); //set the navigation
$page->SetParameter("MENU", $menu);
$page->CreatePage(); //send the page to the browser
?>Code: Select all
<html>
<head>
<title>{PAGE_TITLE}</title>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- this is the menus residing place -->
<td>{MENU}їi]їcolor=red]This should be where the menu shows upї/color]ї/i]</td>etc.
---html-----
<!-- sub navigation html goes here -->
{NAVIGATION_LINKS}
---html---
<!-- this is the subtitle -->
{SUB_TITLE}
<!-- this is where the content goeth -->
{PAGE_CONTENT}
<!-- this is where the footer goeth -->
{PAGE_FOOTER}
</body>
</html>