Static Pages

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
klug
Posts: 7
Joined: Thu Nov 06, 2003 7:20 pm

Static Pages

Post by klug »

Hi all,

we're still very happy with phpMyFAQ 8-)

We'd like to add a few static pages (disclaimer, FAQ of the FAQ, etc) but with the exact template of the FAQ, accessible from links which will be under the Categories ones.

What would be the best way to do it ?
I found the place the categories are printed (in the index.html template), but I don't know how to add the static page.

Thanks.
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

you will need always 2 files: one PHP file and one template file.

Here's an example for you:

Maybe you want to include an disclaimer, then create a PHP file with the name disclaimer.php and a template file in the directory template/ with the name disclaimer.html.

The disclaimer.php has to look like:

Code: Select all

<?php
$tpl->processTemplate ("writeContent", array());
$tpl->includeTemplate("writeContent", "index");
?>
The template file can contain what you wnat to, for an example look into the template kontakt.html.

This new page can be reached with: http://www.yourserver.com/faq/index.php ... disclaimer

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
klug
Posts: 7
Joined: Thu Nov 06, 2003 7:20 pm

Post by klug »

Works great, thanks again !

Next step is to get the BB code working in the static page and add a page to update it in the admin.

Maybe you should add a whole "static" category (not handled exactly as the other categories, with no indexing for the search engine) ?
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

klug wrote:Next step is to get the BB code working in the static page and add a page to update it in the admin.
This is a bigger work...
klug wrote:Maybe you should add a whole "static" category (not handled exactly as the other categories, with no indexing for the search engine) ?
This is an add-on that won't be added to phpMyFAQ. But you can add this feature by yourself quite easy. You need another SQl table and an adminstration page. You can use most of code of the news section...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Will
Posts: 3
Joined: Wed Dec 28, 2005 1:27 am

Post by Will »

Sorry to resurrect an old thread, but does this method still work for the current version?

I'm trying to add a static page of terms by creating a terms.php in the phpMyFAQ root and a terms.tpl in the template directory. I've copied the contents of contact.php and contact.tpl into the new files then tried to access the new page using index.php?action=terms, but it just shows the home page instead of the contact page.

Any advice would be appreciated.
Thorsten
Posts: 15741
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

yes, it's mainly correct until now, but you have to add the string 'terms' in the array of allowed variables in inc/constants.php.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Will
Posts: 3
Joined: Wed Dec 28, 2005 1:27 am

Post by Will »

Thanks, Thorsten. That works fine now.
Post Reply