471,605 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,605 software developers and data experts.

Importing a Menu (Through SSI?)

Hi everyone,

I hope I'm alright in posting this here, I searched and couldn't find any help with this, or even a hint as to where I can ask this.

I'm new to SSI and all that . . . actually just heard of it today. I'm wanting to be able to import a menu so that I don't have to edit each page when I edit something on the menu.

I heard of SSI and figured that would be best. So I looked up on it a bit, my server does support it, and the .htaccess file has been edited to enable it and such.

However . . . How do I get it to import? I saw the code:
Expand|Select|Wrap|Line Numbers
  1. <!- #include file="filename.txt" ->
should work, but nothing is happening. Is that the wrong code? Or is there other code that I need to put to make it work?

I really appreciate the help with this, and apologize if this is the wrong area to ask it. I'm unsure where else to ask, and so figured I would ask here being that the code is being placed in an HTML page and such . . .

Thank you in advance for the help!

PS--the website is workmenforChrist.org. I know the code there needs a lot of work, but that's in the works. I'm trying to first see if I can get the sidebar menu and such working through SSI to start things off . . .

Sep 17 '07 #1
7 1443
4,258 Expert 4TB
The format of the HTML comment is
Expand|Select|Wrap|Line Numbers
  1. <!-- your text -->
so your statement should be
Expand|Select|Wrap|Line Numbers
  1. <!-- #include file="filename.txt" -->
Sep 18 '07 #2
I thought so, that's another code I saw for it.

But it's still not working for me. Nothing is showing up . . .

Would it possibly help to post the contents of the .htaccess file to see if that is right? I tried putting in a code I read was what I needed, but that didn't work. Then I tried going about it by letting the server CP put in the code itself (my host has an option to actually create the file, and has boxes for options I want to use such as SSI, and it puts the code in there for me), but it still did not work. Then I put in BOTH codes and it did not work still. . . sheesh!
Sep 18 '07 #3
Well, I was told by my host that apparently ASP isn't supported by them, so I just used the

Expand|Select|Wrap|Line Numbers
  1. <?php include 'vars.php'; ?>
Instead, and everything I was trying to import, was imported!

The only thing is . . . It may have been just a one-time occurance, but when I first used a link imported, it took a bit longer to get to the linked page than usual. Would importing something like that do that? (I would assume it wouldn't affect load times for links, but I'm just wanting to know from someone who actually knows all this SSI stuff haha.)

Thanks again!

Sep 18 '07 #4
4,258 Expert 4TB
Many times a server is configured for SSI by setting the extension of the embedding script to .SHTML, the most common extension configured to parse SSI by default.
Is that also the case with your server? In that case any other extension will not work properly. If you don't know, find out from your SP.

Anyway, I think that the PHP solution ts still the best.

Sep 18 '07 #5
Yeah, I'm not sure if that is the case of my own host. But I was pretty against the idea of having to change all the extentions to shtml . . . that would mean even more changing of links, an trouble with people who link to my site, and bookmark pages. At best I'd have to create a redirection, but still . . .

But I agree, the php seems to be the easiest way . . . and the least problematic for my users . . . hopefully!
Sep 20 '07 #6
4,258 Expert 4TB
Good luck with your script.

Sep 20 '07 #7
Thanks! :)

Trying to sort through it all to learn just a bit of CSS period. Sheesh, all the info on it and everything, actually makes it harder to learn (at least for me personally)!

But thanks again!
Sep 20 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Ian Davies | last post: by
9 posts views Thread by jillandgordon | last post: by
10 posts views Thread by hendafe | last post: by
29 posts views Thread by Natan | last post: by
7 posts views Thread by Chuck Hartman | last post: by
1 post views Thread by Tom Burton | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.