SSI
Can I call an SSI script (ie footer HTML) that within the called include page, contains another SSI script (ie a banner rotation within the footer)?
If possible, is it bad to make a SSI script call another SSI script? Will it be detrimental to the speed of my page loads?
Mark Hensler posted this at 07:06 — 19th February 2001.
He has: 4,048 posts
Joined: Aug 2000
Welcome to TWF, fifeclub
Yes, you can string SSI pages...
No, I've not experienced any slowing doing this.
fifeclub posted this at 02:48 — 20th February 2001.
He has: 688 posts
Joined: Feb 2001
I tried it on a test basis and I couln't get it to work. What I did is insert the following code into my footer file (which is called by an SSI).
The file secondssi.html has just a simple line of text for testing purposes. When I loaded my page, it successfully called the rest of the footer file but the secondssi.html (text) was not inserted (but it didn't print an error message either). Any ideas what may have gone wrong?
P.S. For background, I want to figure this part out before I proceed with my site redesign because I ideally want to put my banner SSI within my footer SSI, so that if I decide to change my banner script or delete it all together, I won't have to make the changes to every page on my website.
Mark Hensler posted this at 08:12 — 20th February 2001.
He has: 4,048 posts
Joined: Aug 2000
what is the extension of your footer file?
Suzanne posted this at 08:26 — 20th February 2001.
She has: 5,507 posts
Joined: Feb 2000
main page: .shtml?
include with the include: .shtml
tiny snip: .txt
To ease the load on the server, only have the pages that need to be parsed have the .shtml extension. My server allows me to include files in an .html page, but the includes have to be .shtml if they contain more includes or any logic.
... er, what Mark asked is what I'm getting at.
Suzanne
Mark Hensler posted this at 08:28 — 20th February 2001.
He has: 4,048 posts
Joined: Aug 2000
fifeclub posted this at 14:23 — 20th February 2001.
He has: 688 posts
Joined: Feb 2001
That may be it. My footer file was not shtml. I'll give that a shot tonight (I'm at my day job now). If it works it will make future site changes a breeze. Thanks.
BTW, is there an advantage or disadvantage to putting includes in a txt file rather than an html file as Suzzane notes (assuming that there is html code within, but no SSI stringing)? If there are no disadvantages, I'll just leave them as html files (even though I don't even have the or codes within them).
[Edited by fifeclub on Feb. 20, 2001 at 08:37 PM]
fifeclub posted this at 01:39 — 21st February 2001.
He has: 688 posts
Joined: Feb 2001
It worked! Thanks!
[Edited by fifeclub on Feb. 20, 2001 at 08:52 PM]
Suzanne posted this at 22:07 — 21st February 2001.
She has: 5,507 posts
Joined: Feb 2000
The only advantage is if you have it set for HTML to be parsed (it's possible in some situations) and you have the pieces that definitely AREN'T parsed as .txt, you avoid the server unnecessarily parsing the file.
I'm sure it's infinitessimal, if there is a clear advantage from the server perspective. From my perspective, I have the main pages (holders) as .html, the scripted bits as .shtml, and the content and anything else as .txt, which helps me keep the pieces straight in my head when I am editing.
Suzanne
P.S. Glad it works!
Mark Hensler posted this at 07:24 — 22nd February 2001.
He has: 4,048 posts
Joined: Aug 2000
ya....
I think it's more for you... to get a mental picture when looking at the directory....
But it also depends on how your web server is setup. By default, web servers don't parse .html files, but an admin could modify that (to look for SSI for example).
Mark Hensler
If there is no answer on Google, then there is no question.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.