Online Book Reader

Home Category

HTML, XHTML and CSS All-In-One for Dummies - Andy Harris [348]

By Root 1393 0
such variables as the developer name and version number. I typically claim any substantial changes I make to a template, but I always give credit to the original developer. It’s great to stand on the shoulders of giants, and you should give them their due in the documentation. Here’s the info.php file after I made a few changes:

/*

Website Baker Project

Copyright (C) 2004-2006, Ryan Djurovich

Website Baker is free software; you can redistribute it and/or modify

it under the terms of the GNU General Public License as published by

the Free Software Foundation; either version 2 of the License, or

(at your option) any later version.

Website Baker is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU General Public License for more details.

You should have received a copy of the GNU General Public License

along with Website Baker; if not, write to the Free Software

Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

*/

$template_directory = ‘aio’;

$template_name = ‘aio’;

$template_version = ‘1.1’;

$template_platform = ‘2.x’;

$template_author = ‘Andy Harris, from Erik Coenjaerts (WB port)’;

$template_license = ‘Open Source’;

$template_description = ‘Original design from 1234.info. Ported to Website Baker by Erik Coenjaerts.’;

$menu[1]=’Main Menu’;

$menu[2]=’Top Menu’;

$menu[3]=’Extra Menu’;

$block[2]=’Sidebar’;

$block[3]=’News’;

?>

Note that the template has the potential for three different types of menus and three blocks of information. ($block[1] is the main content block and is available by default.)


Modifying index.php

For the most part, you can leave index.php alone. However, there are a few modifications you might make. If you look over the file, it’s basically plain HTML/XHTML with a few PHP functions thrown in. Generally, you can change the HTML code without any worries, but be more careful about the PHP code. The PHP code tends to call special functions defined in the Website Baker code base. Here are the functions and variables you’re likely to run across:

♦ TEMPLATE_DIR: This constant contains the template directory. Use it to make links to the template directory.

♦ WEBSITE_TITLE: Use this constant to display the Web site name anywhere in your template.

♦ PAGE_TITLE: The title of the current page as defined in the menu.

♦ WEBSITE_HEADER: This constant displays the header defined in the admin panel.

♦ show_menu(menuID): This is a powerhouse of a function. It analyzes your site structure and uses it to build a navigation structure. It takes a parameter, which is the level of menu. (Typically the left menu is level 1 and the top menu is level 2, but this can be changed.) Note: Some templates use the more advanced show_menu_2() function, which has additional parameters, like the ability to define template code for how the menu displays.

♦ page_content(blockID): This function is used to display content for the current page. The parameter describes which block of content should display. Use 1 for the main page content, 2 for block 2, and so on.

♦ page_footer(): Display the page footer identified in the admin panel.

Website Baker features many more constants and functions, but these are the basic ones used in nearly all templates. See the online documentation at www.websitebaker2.org for complete documentation. Other CMS systems use the same idea (XHTML templates with PHP functions embedded), but of course the function names are a bit different in a different CMS.

You may want to make other modifications of the default template. For example, the Multiflex-3 template includes multilanguage support and a large number of different “post it note” features. I generally remove the multilanguage

Return Main Page Previous Page Next Page

®Online Book Reader