Adding A Static Page
While making domain portfolio manager we have taken every effort in making the script as easy as possible to extend. 1 of the things that we realized that you may wish to do is add an extra page to the portfolio.
The first thing that we need to do is create our template file. Let's for example assume we are making an about us page your template file may look like this:
<div class='content'>
<h1>About Us</h1>
<p>This is our dummy about us page, we would have the text
relating to our business here.</p>
For the eagle eyed of you, you may notice that the content div has been opened but never closed. you do not need worry about this, this is taken care of in another script.
Now you can save the template file to a name of your choice (please note it should have an extension of .htpl to conform with the template system). As out example is an about us page we will call it about_us.htpl. Once you have saved the file upload it into templates/default/.
Now that you have created and uploaded the template file our next step is to make it useable. The following should be placed in a new file:
<?php
$passToSidebox = array('page_type' => 'misc');
require_once './includes/init.php';
$pageDescription = 'About Us';
$pageKeywords[] = 'about us';
require_once SERVER_PATH . '/includes/header.php';
$template->loadTemplate('about_us.htpl');
$template->show();
require_once SERVER_PATH . '/includes/footer.php';
There are 3 main lines that you need to take note of here, the first line you need to take note of starts with '$pageDescription'. This line dictates what the meta description of your newly created page will be. Secondly the line that starts '$pageKeywords[]'. This line as you can probably guess dictates the meta keywords for the page. Lastly and most importantly the last line that we need to look at '$template->loadTemplate('about_us.htpl');'. In this line you can see that it contains the name of our template file. If you create further pages be sure to change this to the name of your newly created template file.
Now all you need to do is upload this file to your webserver. The file should be located in the portfolio root folder (the same place you will see 404.php, sitemap.php and contact_us.php). You can name this file anything that you wish but it must end with the .php extension.
Congratulations you have created your first static page. Now all you need to do is link to it from somewhere so people can find it.