Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu Editing Across Entire Site 2

Status
Not open for further replies.

AckNack

MIS
Jul 1, 2004
140
US
I have the same menu on every web page on my site and would like to find a way to make changes only once instead of editing each page individually.

I seem to remember seeing an article about using shtm pages to do this, but can't find information on it.

I'm coding by hand for now and would appreciate any help pointing me to information about this.

Thanks. And take it easy on me; I'm an IT guy not a web guy. :)

AckNack
 
Try using SSI (server side includes)

Just put the code of your menu in another file, give all your files the .shtml extension and include the following line in your main documents where the menu should be:
Code:
<!--#Include file="./menu.shtml"-->
This line will place the code of the external file in right where your menu should be, so you will only need one menu file and it will be included in all your pages.

I hope this helps you

Regards

Steven
 
Stoemp:

Great. That's what I was looking for.

Couple of questions:
Will the search engines have any trouble reading that? I've read that I should have text menus on each page as the search engines won't read any other type of menu.

My pages now have .htm extensions. Should I change them all to .shtm or should I use .shtml?

Thanks.

AckNack
 
the extension [tt].shtm / .shtml[/tt] tells the server to look for special SSI tags inside the file, and do something with it.

There's no real difference between .shtm and .shtml - but best practice is to use .shtml.

Faqs on SSI:
[ul][li]faq253-3309 - Best Resources for SSI[/li]
[li]faq253-2000 - What Can I Use SSI For?[/li]
[/ul]

Because it's a server-side include, the search engines won't know it's any different.

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
manarth:

Thanks...that's what I was thinking, but wasn't sure.

I was in the midst of reading the FAQ's and thought I'd post to see if I was on the right track.

I'm definitely a FAQ and how-to reader, but my eyes were starting to cross. :)

Thanks again.

AckNack
 
Just wanted to post again and thank you Stoemp and manarth.
SSI is working great. Much better than editing all those menus.

Now, I just have to get better with CSS and get rid of all those nested tables. :)

AckNack
 
I'm getting CSS working pretty good (haven't put it up on the site yet) but I'm running into a roadblock.

Can anyone point me in the right direction for getting the menu in one location and then somehow called out to all the pages.

It's working great with SSI, but trying to switch over to CSS, I can't find a way to use one menu and make it appear on all the pages from the one location like I'm doing with the SSI

Thanks,

AckNack
 
css is no replacement for SSIs - they're complementary.

html (and files included through ssis) presents the content. css's job is to style the content.

There's some great css examples on positioniseverything.net

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
That's what I'm trying to do: make them complementary. I just can't seem to figure out how to get the menu.shtml page I have to show up in the navigation area of my pages after I styled them with CSS.

The include statement doesn't work if I place it either in the html document or in the css document.

Could it be the DOCTYPE statement I'm using on the page?
This is what I'm using on the shtml pages:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
AckNack
 
The include statement doesn't work if I place it either in the html document or in the css document. Could it be the DOCTYPE statement I'm using on the page?

Take a look at the source code on your server. If you see the SSI statement (and not the contents of your included file) then your SSI isn't being parsed. This will only be caused by the configuration of the server - the doctype won't make any difference to this.


XHTML requires compliant code - if the code isn't compliant, a browser may decide to stop parsing it, and therefore anything after a non-compliant statement may be ignored. (Some browsers won't display anything except an error page if there is invalid code. You can validate your code on the W3C site:
<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
Thanks, manarth. That got me going in the right direction.

I had a duh moment. I was trying to check it on the local machine instead of the web server.

It's working like it's supposed to.

Although, after checking the validation, I see I need to fix some of the code. :)

AckNack
 
The include statement doesn't work if I place it either in the html document or in the css document. Could it be the DOCTYPE statement I'm using on the page?"

Just to explain the points you raised here.

The SSI is *server* side as mentioned, therefore it has nothing to do with CSS, doctypes, browsers or anything else. The SSI simply inserts places the content into the document before it is sent to the browser.

After the document is sent to the browser this is where your CSS (and doctype etc) starts it's job. The CSS styles your document. The function of the doctype in simple terms is to tell the browser what type of code you are using, html 4, xhtml 1 and whether it is "strict" or "loose" for example.

Also, about something mentioned earlier. SSI extensions, you can actually use SSI with .htm, .html extensions but this is set by your server admin. .shtml is the common one, .shtm MIGHT work if your host allows it.

p.s. SSI can do a LOT more than just including one document into another. Tey Big Nose Bird or the XSSI Library for good examples.
(switching to PHP would be an even better strategy)






<!--#sig value=''É'' url='' -->
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top