|
|
|
Templates
Starting with BosNews 6.0, the script now uses templates to display your news articles, archives and categories.
While BosNews starts off as an embedded script in one of your own pages, such as your index page, anytime the user clicks on a link BosNews creates it's own page. In order to create this page, you must create and upload a template for the system to use.
Your template may be either an HTML page, or a PHP page. When uploading your file, make sure you set the file type correctly.
HTML template
To create an HTML template, simply create your HTML page like you would for any other web page on your web site. BosNews will place it's content into your web page, and display the page to the user. BosNews will look for a very specific phrase inside of your HTML template, and replace that phrase with it's own content. The phrase you must have in your template is %display%. BosNews will change the %display% into the 's it creates when viewing articles, archives, etc.
HTML Example:
<html>
<head>
<title>My News</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="robots" content="index,follow">
</head>
<body>
<table width="100%" vorder="0">
<tr>
<td colspan="2">This is my header content</td>
</tr>
<tr>
<td width="150" valign="top">My Menu</td>
<td valign="top">%display%</td>
</tr>
</table>
</body>
</html>
PHP template
The PHP template works pretty much the same as the HTML template does. However, in this case, BosNews loads the variable name of $displayData. So, instead of placing %display% as you do in the HTML template, you will echo $displayData.
PHP Examples:
<html>
<head>
<title>My News</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="robots" content="index,follow">
</head>
<body>
<table width="100%" vorder="0">
<tr>
<td colspan="2">This is my header content</td>
</tr>
<tr>
<td width="150" valign="top">My Menu</td>
<td valign="top"><?php echo $displayData; ?></td>
</tr>
</table>
</body>
</html>
<?php
echo<<<END
<html>
<head>
<title>My News</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="robots" content="index,follow">
</head>
<body>
<table width="100%" vorder="0">
<tr>
<td colspan="2">This is my header content</td>
</tr>
<tr>
<td width="150" valign="top">My Menu</td>
<td valign="top">{$displayData}</td>
</tr>
</table>
</body>
</html>
END;
?>
|
|