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!

wullie or anyone.. 4

Status
Not open for further replies.

coldfused

Technical User
Jan 27, 2001
2,442
US
Will one of you guys please demonstrate to me a shtml index index page that calls in a headergraphic, a left navigation, content and footer..Sort of like a frameset but with using ssi instead..

I'm really trying to grasp this, and I am for the most part, just need a little example..

Company I work for wants to start building all new sites with ssi for the most part..Need to get comfortable with this right away..

Any help would be great..I have read a ton of tutorials, and understand how to call the files in using

&quot;<!--#include virtual=&quot;test.html&quot; -->&quot;

(without the quotes of course, wasn't sure if tek-tips would try to call the file :)

Just none so far have had a complet example of a page built using only ssi.

Thanks in advance guys..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Here's a simple example:

<table width=&quot;100%&quot;>
<tr>
<td colspan=&quot;2&quot;><!--#include virtual=&quot;header.html&quot; --></td>
</tr>
<tr>
<td width=&quot;150&quot;><!--#include virtual=&quot;left_menu.html&quot; --></td>
<td><!--#include virtual=&quot;content_page.html&quot; --></td>
</tr>
<tr>
<td colspan=&quot;2&quot;><!--#include virtual=&quot;footer.html&quot; --></td>
</tr>
</table>

Pretty much, you can do anything that you want with html, javascript, etc. in that page. The SSIs don't affect it.

Rick
 
Hi,

I believe the following to be true:

To include pages and simulate a frameset without the stationary frames when scrolling you use 1 of 2 SSI commands.

1 - <!--#include file=&quot;test.html&quot; --> where test.html is in the same directory as the page that is using this SSI command.

2 - <!--#include virtual=&quot;test2.html&quot; --> where test2.html is in a different directory as the page that is using the SSI command. EX- index.html in the root calling page3.html in a directory called pages would look like this:
<!--#include virtual=&quot;/pages/page3.html&quot; -->

My site uses mainly only SSI to call the banner portion, the content portion and the footer portion of my web site.

Hope this helps!
greenjumpy.gif
NATE
design@spyderix-designz.com
 
Hi guys,

Ok, firstly, it depends if you are actually going to use SSI for anything other than simply including files.

For the sake of making this easier, I will assume that your server parses .shtml pages for SSI.

Any file that uses SSI must be named .shtml, whether that file is called 20 pages deep or on the main page. Lets say that you have the following:

<!--#include virtual=&quot;/top.shtml&quot; -->
<!--#include virtual=&quot;/middle.shtml&quot; -->
<!--#include virtual=&quot;/bottom.html&quot; -->

The following is an easy example of what would be in those files.

-----------------------------------------------------------

Top.shtml

<html>
<head>
<!--#include virtual=&quot;/Meta.shtml&quot; -->
</head>
<body>

Middle.shtml

This is all the content for my page, I can also use SSI directives inside this page because it is named .shtml

Bottom.html

</body>
</html>

Meta.shtml

<!--#if expr=&quot;${DOCUMENT_URI} = /page1.shtml/&quot; -->
<TITLE>Page 1 Title</TITLE>
<META name=&quot;description&quot; content=&quot;&quot;>
<META name=&quot;keywords&quot; content=&quot;&quot;>
<!--#elif expr=&quot;${DOCUMENT_URI} = /page2.shtml/&quot; -->
<TITLE>Page 2 Title</TITLE>
<META name=&quot;description&quot; content=&quot;&quot;>
<META name=&quot;keywords&quot; content=&quot;&quot;>
<!--#endif -->

-----------------------------------------------------------

Now, in the above example, if the url of the page is page1.shtml, then the page 1 title and metas are shown, whereas if the url is page2.shtml, then page 2 metas as shown.

There are loads of things that can be done with SSI, such as server side browser checks and conditional includes based on that, show the time, run server commands (ping, etc).

If you want to know anything else, just ask.

Hope this help Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Thanks alot guys, you pretty much covered everything I need to get started..Yes the server runs ssi, and yes it will be just simple includes..

One thing only the page that usses ssi has to be named shtml right..If I am calling in html pages that use no ssi on there own, they only need the html extension, but if one of the files called into the original shtml file also uses ssi it must also contain the shtml extension..Am I correct?

Thanks for your time..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
100% correct. [smile]

It is the best practise to only use shtml for files that either currently use SSI or possibly will in the future.

If you simply name all files shtml then the server looks for SSI directives within every one of those files. While this may not make a noticable difference on a small site, a large site could take a huge processor hit because of it.

Hope this helps Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Good day all..Thanks again..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
You use SSI and not PHP includes? Is there a reason? Or by SSI, do you mean server side (php being included) includes?

Rick
 
Oh. Ok. I thought you meant you used SSI in a PHP page, but I guess that wouldn't work in a page named *.php.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top