View Full Version : left vertical menu changes page content

03-11-2010, 10:50 PM

I'm wanting to build a pages(s) with a vertical left menu in css.

Clicking on each menu list item should update the content to the right (main body text) and introduce a marker to indicate which menu item you are on - this could just be a change in style e.g. bold font, or a small arrow image, bullet etc.

Initially I was thinking of creating a page for each menu item, and a menu for each page. The problem here is e.g. 10 menu items would require 20 files with essentially the same content. This would also mean updating 20 times if any changes were needed.

Could someone tell me when the best practice is to gain the functionality I'm after?

Below is an image to illustrate the above:

03-11-2010, 11:12 PM
I'm using php so perhaps I could use dynamic css?

e.g. the menu links would be:


Then in the php echo the correct left menu style and main body content.

Does this sound the way to go?

03-12-2010, 12:12 AM
Hello htcilt,
Sounds like you're after an include. You can make a menu.php that will be included on all your pages. Updates on that one file would be reflected on all the pages it's included on.
Have a look at the basics explained here - http://www.tizag.com/phpT/include.php

03-12-2010, 07:17 PM

Thanks for the reply.
Yes an include is just what I'm after for the menu.

I'm also using an array to store each 'theme', then applying the required styles. This following link is really useful:

It took a bit to get my head around it, but its coming along nicely now :)