Forum Moderators: mack

Message Too Old, No Replies

Site menus

How to handle?

         

johnnie

9:45 am on Sep 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello,

What is the best way to handle frequently occurring code like a site menu and/or div structure? Do you use SSI to accomplish this, PHP includes or is there some other way to handle this?

Or do you just plain C/P the HTML into a new document?

What is the most common, effective and best practice?

scatcat

10:57 am on Sep 2, 2004 (gmt 0)

10+ Year Member



Hi,

I use includes.

If you look at your site you should find one or two areas that appear on all pages: menu, header, footer, etc

I code them separately and include them.

I would warn against C/P, since a simple change on the menu, for instance, would then have to be changed on every page individually.... argh!

shigamoto

7:44 pm on Sep 3, 2004 (gmt 0)

10+ Year Member



I believe Includes are the best when it comes to these type of things. It's easy to learn and doesn't take much time getting it up and running.

Good luck!

lorax

2:56 am on Sep 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It depends upon the size of the website. If it's a relatively small site (50-100 pages) then I'll just leave the nav as part of the file. A search and replace tool is your friend here. If the site is expected to grow beyond it's small stature then I'll use PHP includes from the getgo. I simply haven't used plain ole SSI as much as I probably should.

vkaryl

3:18 am on Sep 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've changed over to php includes all the way - for even the sites I run that are under 50 pages. It's far simpler and faster, why waste time?

Reflect

6:08 pm on Sep 8, 2004 (gmt 0)

10+ Year Member



In also use SSI. The only thing on a given page of mine that is NOT an include, that you see, is the content.

Take care,

Brian

sjthomas

9:18 pm on Sep 9, 2004 (gmt 0)

10+ Year Member



Personally I'd use a package like dreamweaver where you can create a template for a site. Then you can just edit the template and it will change all the pages created using that template. It really is a lifesaver at times. Of course you can embed a PHP Include or an SSI statement within the template if need be, saving you a bit more time.