Example: creating an ‘About Us’ page
1. Create a file called about.tpl place in templates folder where main.tpl is etc
about.tpl to contain:
Code:
{capture name="title"} - {l}About{/l}{/capture}
{capture assign="in_page_title"}{l}About{/l}{/capture}
{capture assign="description"}{l}About Us{/l}{/capture}
{include file="header.tpl"}
{include file="top_bar.tpl"}
Your Content Here.
{include file="footer.tpl"}
2. Create a file called about.php, place in root where index.php is etc.
about.php to contain:
Code:
<?php
require_once './init.php';
$path = array ();
$path[] = array ('ID' => '0', 'TITLE' => _L('SITE_NAME'), 'TITLE_URL' => DOC_ROOT, 'DESCRIPTION' => '');
$path[] = array ('ID' => '0', 'TITLE' => _L('About'), 'TITLE_URL' => '', 'DESCRIPTION' => _L('About'));
$tpl->assign($data);
$tpl->assign('path', $path);
echo $tpl->fetch('about.tpl');
?>
Notice about.php fetches about.tpl (at the bottom)
3. Call the new page up by placing destination link wherever you want to place it, like this:
Code:
<a href="{$smarty.const.DOC_ROOT}/about.php">About Us</a>
You can use this template process for any other new pages you wish to create.
