Projects/kde.org/Capacity HOWTO: Difference between revisions

From KDE TechBase
No edit summary
No edit summary
Line 32: Line 32:


   <?php
   <?php
     // promote which site we are!
     // promote which site we are, we are www.kde.org in this case!
     $site = "www";
     $site = "www";
    
    
Line 40: Line 40:
     // promote title to use
     // promote title to use
     $site_title = i18n_var("K Desktop Environment");
     $site_title = i18n_var("K Desktop Environment");
    // links in the top
    $menuright = array ('family/'=>'Sitemap', 'contact/'=>'Contact Us');
   ?>
   ?>


Even in the site.inc you can already use the i18n-functions!
Even in the site.inc you can already use the i18n-functions!

Revision as of 05:55, 5 October 2006

Introduction

Capacity is a versatile framework which helps you to construct your page by focusing on the content. Your pages will be simple PHP-files which include predefined header and footer. This header/footer layout the page, you only provide the real content and menu structure.


Example PHP-file

Any normal page just contains:

 <?php
   $page_title = "Page Title";
   include "header.inc";
 ?>;
 
 Content of the web page
 
 <?php include "footer.inc"; ?>

For each subsite, a site.inc in the toplevel directory of this page, which would be equal to the later documentroot on the server in many cases, may be created. This include is used by the header.inc, it should contain some information about your site, like it's name and the email address of the webmaster, this will be used by header/footer to setup the page correct.

An example site.inc would be:

 <?php
   // promote which site we are, we are www.kde.org in this case!
   $site = "www";
 
   // use new style ;) yeah
   $templatepath = "newlayout/";
 
   // promote title to use
   $site_title = i18n_var("K Desktop Environment");
   // links in the top
   $menuright = array ('family/'=>'Sitemap', 'contact/'=>'Contact Us');
 ?>

Even in the site.inc you can already use the i18n-functions!