Jump to content

Recommended Posts

Posted

I'm putting together a new site and I'm trying to get it to use two (2) include directives, so I can have my main menubar be one .txt file and my content be another. I'm using the code below to try it, but it will only look the top one.

 

><!--#include virtual="/menubar.txt" -->
<!--#include virtual="/mtblogs/articles.txt" -->

 

Yes, there is a folder named mtblogs which articles.txt resides in. I loaded that one fine before I tried to put the menubar.txt as an include. But when I try to load both only the top one (menubar) appears on the page.

 

Is this just as far as shtml goes? I can only include once?

 

If so, is this something that PHP could do for me? (I've never tried anything with PHP yet)

 

Thank you in advance for your help.

Posted (edited)

I moved this to the Scripting Talk forum for better exposure.

 

As for your problem, I've never used server side includes but I don't think there's any restrictions on how many files you can include.

 

Have you tried putting articles.txt above menubar.txt and see if it works? If so, then perhaps it's something on menubar.txt that is preventing articles.txt from loading.

Edited by TCH-Raul
Posted
I've never used server side includes but I don't think there's any restrictions on how many files you can include.

 

Have you tried putting articles.txt above menubar.txt and see if it works? If so, then perhaps it's something on menubar.txt that is preventing articles.txt from loading.

I didn't think about doing that only because menubar.txt includes my HEAD section.

 

I put that in menubar.txt because part of my menu bar is a javascript.

 

I'll try saving menubar.txt from the BODY down.

Posted

It seems to be functioning ok If I only do the include on everything below body and not the head.

 

May make things a little strange if I change the menubar, which is why I wanted to use the server side includes.

Posted

Note that those included files are interpreted as HTML, so make sure that it all is formatted correctly. Things like missing closing tags in menubar.txt could cause the rest of the document to fail to display, or display incorrectly.

 

As for server side includes, there is no limit on how many you can have in a page.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...