PDA

View Full Version : A quick question



juanc
08-04-2004, 01:24 PM
Hi there

Apologies if this post should ideally be in the help section but I wondered if anyone can just give me abit of an overview of how templates or customizing the look and feel of this application is done.........

ie. how do I get started.

thanks very much

pbflash
08-04-2004, 01:41 PM
I believe the main files to change the template are the user_top.php, user_bottom.php, menu.php, and the css file which should all be in the directory for the template you are using. If you are using the generic template then there will not be a menu.php file.

frobn
08-04-2004, 02:33 PM
Hi Juanc

Here is a brief howto on building a template. Corrections, additions and improvements are encouraged.

Creating a template is fairly straight forward.

First to understand how OR builds the html files open index.php in the main directory. At the top you will see something like the following:

<?php
include("include/common.php");
include("$config[template_path]/user_top.html");

?>

The first file included is common.php which stores the path to the user_top.html and all the other variables that you configured when you setup OR. The next file called is the user_top.html.

Every file in OR starts out the same way. Then comes the content and at the bottom:

<?php

include("$config[template_path]/user_bottom.html");

?>

Now look in your template directory and you will see the template sub-directories vertical-menu, generic and any other templates that you may have set up.

Open the vertical-menu directory. The files you are most interested in are:

user_top.html
user_bottom.html
menu.php
the .css files

you probably won't need to do anything with the admin files or the style.php and will just copy them into your new template directory.

First build a style sheet for your fonts, colors and layout.

Next build the menu.php file which is the html for your navigation menu.

Then build the top and bottom html files.

Think of both user files as a table with 3 rows which is the way verical-menu is set up.

The first row contains the header.
The next row contains two columns, a left column which contains the navigation menu and a right column which contains the OR content. The last row is for the footer.

user_top.html is built in the following way;
<html>
<head>
Put title, meta tags and style sheets here
</head>
<body>

<table>

<!-- first row for the header-->
<tr>
<td>
header goes here
</td>
</tr>

<!-- second row for the menu and the OR content-->
<tr>
<td>
(include menu.php that you already built --- menu.php contains the navigation for OR)
</td>
<td>
<!--end of user_top.html
This is all there is to the user_top.html and is what is included at the top of every OR content file

**************************************
-->

Now build user_bottom.html
Since user_top ended with an open column the first thing you do is to close the column and row.

</td>
</tr>
<!-- third row for the footer-->
<tr>
<td>
footer goes here
</td>
</tr>
</table>
</body>
</html>
<!--end of user_bottom.html
********************************
-->
Create a new sub-directory in the template directory, copy the admin files, and style.php to your new template directory. Add your new menu.php, and new user_top and user_bottom files. Open common.php and change "$config[template_path] and $config[template_url] to your new template.

Last test your your template.