| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jan 2008
Posts: 2
|
Ok, I'm new to php, but I know how to include pages in other pages...actually that's about all I know. I'm pretty much using a top and a bottom page as well as a menu page to make my site come together. I'm not the one who updates it regurarly so I'm trying to make everything as easy as possible for my client. My issue is, the amount of links on the sidebar is getting ridiculous and I want to shrink the subcategories so they're only open when I'm in that section of pages, but I still want to be able to edit the links from one single page so they change sitewide. I've already figured out how to do it with 6 different menu pages...but then I'm right back to editing links on 6 pages and copy/pasting everything...and that's what I'm trying to avoid. Any ideas? I dont know what shape the site will be in when you look at it, I'm still working on cleaning it up before it goes live... chelmsfordcommunityeducation.org/mirror Last edited by dksilvia : 04-01-2008 at 13:01. |
|
|
|
|
|
#5 (permalink) |
|
shiro
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 3,066
|
Javascript is probably your best bet, but if you want to do it in php, you can use a database to store the section names and the page names. Then call the names with php. This makes it really easy to add both sections and pages, because you just add everything to a new row in the table (or tables if you decide to use separate tables for the sections and the page names). To only show the names of the pages for the section you are in, have the script check to see if the current page is included in the section its outputting, and if it is, to output all the pages for that section. The rest of the sections will fail this test, so they wont be outputted. You can put all this into one file, and include it into all pages that you program. This method is also good because it will still work even if a user has javascript turned off. |
|
![]() |