PHP
  Home arrow PHP arrow Page 6 - Dynamic Generation of Menu Structures ...
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Dynamic Generation of Menu Structures and JavaScript Rollovers in PHP
By: Chris Mospaw
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 9
    1999-05-10

    Table of Contents:
  • Dynamic Generation of Menu Structures and JavaScript Rollovers in PHP
  • Making a Template
  • Starting to Automate
  • The power of repetition
  • Ordering up a Menu
  • Adding Pages

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Dynamic Generation of Menu Structures and JavaScript Rollovers in PHP - Adding Pages


    (Page 6 of 6 )

    Now that the TEMPLATE.HTML file is completed (with the possible exception of changing the table border to 0), it can be used as the basis for new pages on the web site. Just do a SAVE AS to the filename of the new page, and put the page content in the "3 - Main Body" area.

    Don't forget to go into PAGES.HTML and add the name of the new page to the array definition. By the way, the pages named in the array display in the menu in the exact order in which they occur in the array. By altering this order, you can alter the order in which pages appear in the menus.

    You will also need the following 5 graphics files for each page:
    • FOO-H.gif - header graphic
    • FOO-B.gif - graphic panel that changes when hovering over buttons
    • FOO-OFF.gif - default button displayed for non-current page
    • FOO-ON.gif - button displayed when onMouseOver
    • FOO-IN.gif - button graphic displayed when page is current

    (GIF files were used in this example. JPG's and PNG's work just as well. Just remember that every file of each type must be the same format.)

    Adding one page or one hundred pages is now just a matter of using the template file and then generating the graphics files.

    Using PHP for the dynamic generation of menu structures and JavaScript can dramatically cut the time it takes to develop a site, and certainly makes site maintenance a breeze compared to having to edit each page when other pages are added or removed. Adding or deleting pages from the site's menu structure is now just a matter of making minor changes to a few files, and producing some graphics.

    Another good use for PHP is separating the content of a page from the structure of a page, thus making site maintenance even easier and nearly eliminating formatting mistakes, but that's a subject for another article.

    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

       

    PHP ARTICLES

    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT