Forum Moderators: open

Message Too Old, No Replies

How to use includes (header footer etc.)

Best way to make a low maintenance site

         

Mcadieux

5:49 am on Jan 28, 2005 (gmt 0)

10+ Year Member



Ok hopefully this isn't to big of a question. I am making a site and have a menu across the top. I want this menu on all of my pages what is the best way to do this. I was going to make my pages .shtml and use the include command but after researching it, it seems that this is a bad idea for search engines etc. Is there any other good way I don't want to put the menu itself on everypage because I don't want to have to update 300 pages to change a menu link.

tomda

7:05 am on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Could you explain why using include is bad for search engine?

Include file (in PHP/ASP) are server-side script and they will output the header/footer in html, so it is not bad for search engine.

Do not hesitate to use include file, it will save you time.

I usually have an include file for:
- the header itself;
- the log bar (membership - log off/in, register, profile, etc.);
- other features (print, send to, bookmark, etc.);
- the menu bar; and
- the footer

tedster

7:07 am on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure where you read the advice about server side includes - but I certainly don't agree. SHTML is a very good way to accomplish your goal, and there is nothing about the technology itself that causes search engine problems.

PHP or ASP includes would be other solid approaches, if you have the support from your web host.

<added>
I see tomda and I were typing at the same time. That makes two votes!
</added>

Mcadieux

8:09 am on Jan 28, 2005 (gmt 0)

10+ Year Member



Hrmmm. I read when I did a search for .shtml on this forum. People mentioned stuff about not being able to get good results using a .shtml, and something about the spider not seeing the include file. To me this would be a problem if all of my links are in the include file. I can use either php or shtml. ASP I don't really know anything about. I just want to use one so I can make things low maintanence. I found out the hard way about puting a menu on 300 pages. Then deciding you want to change a link.

buckworks

8:23 am on Jan 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Something to watch out for: SSI's can make maintenance much easier, but a validation error in an include can end up on hundreds of pages along with the good stuff.

Don't ask me how I know that ...

TheDoctor

4:48 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But I bet you were able to fix it pretty fast...

HughMungus

4:58 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mca, do yourself a favor and start doing your sites in PHP instead of plain HTML *now*. I did a a plain HTML page with .shtml and includes and I'm kicking myself for not converting to PHP sooner. It just makes everything easier and it's not hard to learn at all. In fact, you can continue to do your sites in plain HTML on your PHP host and just convert various parts of your site to PHP as you go along (to decrease the incline of the learning curve).

Mcadieux

6:14 pm on Jan 28, 2005 (gmt 0)

10+ Year Member



Before I get started will google see the actual include page when it spiders? WIll it pick up on the keywords and links in the include file? I am trying to Do SEO on this page as I go along.

buckworks

6:20 pm on Jan 28, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Yes.

All the "including" is done on the server before the page is served, so Google et al. can see all content without difficulty.

Mcadieux

6:34 pm on Jan 28, 2005 (gmt 0)

10+ Year Member



Thanks so much for all the help. This site is the best. I would be lost withought it