PDA

View Full Version : Best way to make new pages


circlecity
05-13-2006, 06:12 PM
I want to create some new pages that use my current template design, like link or partner page.

What is the best method to do this?

Ryan
05-13-2006, 06:18 PM
Copy one the files and remove all but 3 lines of code. Then create a template page within the template directory.

circlecity
05-14-2006, 12:45 AM
So I take say index.php and leave the top 3 lines?

Ryan
05-14-2006, 01:29 AM
This is what you should have in the template:
<?php
include('./global.php');

$tpl->output_page('template_name');
?>

Jakobi
06-09-2008, 01:07 AM
Is this still the best way to do this?

Ryan
06-09-2008, 09:40 PM
Only difference is changing:
$tpl->output_page('template_name');
to:
$init->tpl->output_page('template_name');

Jakobi
06-11-2008, 07:54 AM
So if I wanted a blank page. Meaning the same sidebars and all but just replace the file list, then I would just then:

Maybe take viewed.php from the root. Put this:

<?php
include('./global.php');

$init->tpl->output_page('blank.php');
?> Then I would make a template page in my templates folder called blank.php. Then that would have the data for what I want on the page?

Making sure I am trying this correctly.

Jakobi
06-13-2008, 09:41 PM
Figured it out. Works with this:

<?php
include('./global.php');

$hs->tpl->output_page('xxx');
?>

The xxx should not have the php extension as well. All is now good.

Jakobi
06-13-2008, 10:14 PM
Added to my htaccess fine. Now the page is missing a page title. If I just added a regular page title would there be any thing wrong with that ?

Didnt know if there was a better way to do. Say with the template file name or something.

Ryan
07-02-2008, 08:41 PM
You can set your page title by doing one of to things. Add this line above the output page line:
$title = 'Your page title';
Or you can change this line:
$hs->tpl->output_page ('xxx');
To this:
$hs->tpl->output_page ('xxx', 'Your page title');

Jakobi
07-03-2008, 01:33 AM
Thanks for the pointer. I used this, thanks.

$hs->tpl->output_page ('xxx', $phrase['xxx']);

You can set your page title by doing one of to things. Add this line above the output page line:
$title = 'Your page title';
Or you can change this line:
$hs->tpl->output_page ('xxx');
To this:
$hs->tpl->output_page ('xxx', 'Your page title');