Add static content to XOOPS - the easiest way

easily add static content to xoopsDo you know the situation you need to add a page with static content to xoops, using XOOPS layout? Content, that will never ever change (… at least not every day), where you do not need the ability to edit content via administration and database?

You will edit files with an editor and upload with ftp? Company or products information? Existing html-pages you want to place within your domain using the same layout your XOOPS CMS does? You want to have nice URLs? Here is the easiest way, at least for me …

This is what I did, adding some static pages into a xoops site. It is not the way a coder would use, but … hey, I’m always looking for quick but usable solutions. In this case, it was a small company page. …

1. Create a folder in XOOPS root, label folder as you would like to have in your URL. In my example, i will use “information”.
2. Open your editor, create a file named company-information.php
3. Write the following into this file:

BE CAREFUL WHEN COPY + PASTE, this BLOG does NOT display ” ‘ ‘ “ correct, please use the lines from inside the textfile company-information.txt instead.

<?php
include('../mainfile.php');
include(XOOPS_ROOT_PATH.'/header.php');
# With the following you can override xoops smarty information, just 2 examples, everythink is possible ...
$xoopsTpl->assign('xoops_pagetitle', 'information about xxx');
$xoopsTpl->assign('xoops_meta_description', 'the meta description you would like to see for this page ...');
?>

<!-- Start HTML -->

<h2>Our company</h2>

<p>some text here ...</p>
<p>more text here ...</p>

<!-- End HTML -->

<?php
include(XOOPS_ROOT_PATH.'/footer.php');
?>

4. Upload file to destination folder /information
5. Manually link to yourdomain/information/company-information.php (Create your own block or use Link-modules …)
6. That’s it!

I will show another solution to easily add static content, but using the ability to set blocks and handle things like with a “normal” module (mainmenu, blocksettings, …). This will be the next part, comming soon …

happy xoopsing!





Leave a Reply

You must be logged in to post a comment.


SITES of the MONTH : 08/2005: linux-gamers.net - fireworks.verno.ru | 09/2005: viapontedinona.it
10/2005: RF Online Base | 11/2005: FREE-EOS | 12/2005: Asian Car Styling | 01/2006: DSLnachPankow.de
02/2006: Roma Victor Camp | 03/2006: NABUUR.COM | 04/2006: Styling+Design-Noord | 05/2006: VETOFISH
06/2006: Utah Antique Machinery News | 07/2006: lebuccaneer.com | 08/2006: Top-logiciel
09/2006: Concrete Connections | 10/2006: Fios Uniao | 11/2006: Casafree Maroc | 12/2006: Ainpg.com
1/2007: Parent Solo


xoopsfactory.com/blog powered by WordPress | Entries (RSS) | Comments (RSS)
Kugelschreiber, Buntstifte und mehr