|
|
|
|
|
|
| |
Let Daryl help you help your users. In this article, Daryl provides PHP code to help your users to navigate through your website and knowing exactly where they are at all times. Read more ...
One of the simplest but most important Web interface necessities is always letting the user know where he or she is within your site. This is most often done using visual cues such as highlighted navigation items, which often match the rollover states of the navigation items.
While many content management systems and application frameworks have this sort of functionality built in, these code bases are overkill for simple sites. You don't need Broadvision or Vignette or even any of the Nuke permutations for a 5-10 page brochure site.
Arguably, maintaining such a brochure site requires little enough effort that a templating system isn't even necessary, but I always find it preferable to have one set of templates to maintain. Setting your site up in this manner ensures consistency across pages, and consistency is as important for a small site as for a gargantuan portal (and maybe moreso).
Let's start with some assumptions for our first example. We're working on a 5-page Web site containing pages for home, about, contact, products, and services. All files for the purposes of this example are in the document root directory, and they all share the basic site template. In the navigation, whenever you mouse over any of the five navigation items, the rollover graphic changes colors.
What we wish to accomplish is having the appropriate navigation item for each page highlight automatically when a visitor loads the page. Since this is simplified templating, we've got a top.php, a bottom.php, and a file containing content for each of the five pages. The top and bottom templates contain all the graphical elements and tables that form the design of the site. And each of the content pages encloses its content with php tags to include top.php and bottom.php.
Read More... |
|
| |
| Web Development With PHP FastTemplate Categories : PHP, Templates, FDF | | | Using PEAR HTML_Template_IT For Modular Interface Design Categories : PHP, PEAR, Templates | | | Simple PHP Templates With PatTemplate Categories : PHP, Templates | | | Writing Your Own Template Caching Class In PHP Categories : PHP, Cache, Templates | | | Injecting XML Content Into Page Templates With patXMLRenderer (part 1) Categories : PHP, XML, Templates | | | Working with Dates and Times in PHP Categories : PHP, Date Time | | | 10 PHP Functions I Bet You Didn't Know About! Categories : PHP, PHP Functions, Filesystem, Arrays, Errors and Logging | | | Using the .NET Assembly in PHP Categories : PHP, .NET | | | Date Arithmetic With MySQL Categories : PHP, Databases, MySQL, Date Time | | | Saving Images in MySQL Categories : MySQL, PHP, Graphics, Databases | | | PHP References Explained Categories : PHP References, PHP | | | Aspect-Oriented Programming and PHP Categories : PHP, Aspect Oriented Programming | | | Beginners guide to PHP and MySQL Categories : PHP, Beginner Guides, Databases, MySQL, Installation | | | Logging with PHP Categories : PHP, Log Files | | | Who's Linking? Categories : PHP, Beginner Guides, To PHP | |
| |
|
|