The fastest easiest way to get it right.

Making a Public Template

A typical Anromeda system will have a public website and a private admin interface.

The public website must have its own 'template'. A template is at least one PHP document that lays out the overall look and feel of the site. A template usually includes as well images, CSS files, and Javascript files.

When you create a public website, you must create a directory in your 'templates' directory. The example below shows the directory structure for the Andromeda documentation system (which is very simple and only has 4 files in it).

Here is what is going on:

  • The Andromeda documentation is itself an Andromeda application with code 'adocs6'.
  • The tree in the image shows the entire directory tree for the 'adocs6' application.
  • The 'templates' directory is created by Andromeda when the application is built for the first time.
  • The 'templates/adocs6' subdirectory has been added by the programmer.
  • The most important file in the 'templates/adocs6' subdirectory is index.php, this file establishes the look of the site.

A Super Simple Template File

The simplest possible template file, stripped of all DOCTYPE declarations and other stuff looks like this:

echo ehStandardContent();

Every template must have those three lines in it. The first line loads whatever stylesheets are required by Andromeda and by any calls you have made to cssInclude.

The second line outputs the content that was created in your page.

The third line tells Andromeda to load up Javascript files and the results of any jqDocReady() and jsInclude() calls you have made.

A Complete Example

Here is the full text of the index.php file for the Andromeda documentation site:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<link rel='stylesheet'
     href='templates/adocs6/adocs6.css' />
<link rel='stylesheet'
<script type='text/javascript' src='clib/jquery-1.2.3.js'></script>
<script type='text/javascript' src='appclib/src/prettify.js'></script>
<script type='text/javascript' src='appclib/src/lang-ddyaml.js'></script>
<div id='a6wrapper'>
    <div id='a6banner'>
      <a href="index.php" style="float: left;">
        <img src='appclib/logo.png'>
      <div id='a6bannertext'>
        The fastest easiest way to <i>get it right</i>.
    <div id='a6links'>
        <div style="float: left">
        <a href="index.php">Home</a>
        <a href="tableofcontents.html">Documentation</a>
        <a href="downloads.html">Download</a>
        <a href="credits.html">Credits</a>
        <a href="contact.html">Contact</a>
        <a href="index.php?gp_page=x_login">Login</a>
        <div style="float: right; font-size: 80%">
        <form style='display: inline' action="index.php">
        <input type="hidden" name="x6page" value="search" />
        <input type="submit"  value="Search: " 
               style="border: 0; background-color: white;" />
        <input style="border: 0; background-color: silver;height: 15px;"
        <div style="clear:both"></div>
    <div id='a6body'>
        <?php echo ehStandardContent()?>
    <div style="clear:both"></div>
    <div id='a6foot'>
        <a href="index.php">Home</a> | 
        <a href="tableofcontents.html">Documentation</a> | 
        <a href="downloads.html">Download</a> | 
        <a href="credits.html">Credits</a> | 
        <a href="contact.html">Contact</a> | 
        <a href="index.php?gp_page=x_login">Login</a>
        Andromeda © Copyright 2004-2009 by Kenneth Downs, 
        Licensed under the 
        <a href=""
        >GPL Version 2</a>
        Andromeda written by Kenneth Downs with contributions by <a href=
        "">Donald J Organ IV</a>
        Several 3rd party pacakges also included, see <a href
    function() {
        var x = $(this).html();
comments powered by Disqus
Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2013, Licensed under the GPL Version 2