SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Addict gthorley's Avatar
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am setting up a navigation area with rollovers. If I plan to include this nav area on all or most of my html pages can I use SSI?

    If I can would appreciate if someone could describe what is involved ie: do I create the menu with its javascript etc on a seperate page say called navbar.html and then place in my index.shtml page <!--#include="/navbar.html"-->. How do you make sure it gets placed exactly where you want it? Is the call placed inside a table or would the call no matter where it is entered in the body of your page place the menu in the exact place that it is on the navbar.html page. Is it possible to get this to preload first and place the rollover images into cache?

    Are there any pros and cons to this. I know it helps if you change the menu names but what about downsides.

    Last does anyone know of any good sites to read up on this SSi function. I did some searchs and found very little that seemed to help

  2. #2
    Misfit
    Join Date
    Apr 2000
    Location
    Pennsylvania, USA
    Posts
    2,266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, first off, you posted this in the wrong forum But I'll see if I can answer your questions anyway...

    I am setting up a navigation area with rollovers. If I plan to include this nav area on all or most of my html pages can I use SSI?
    Most people use SSI in parts of a design that they know will be changing (IE: like a right bar news section on each page). Then, instead of changing each page with the updated news, they'd just have to change the SSI file. For more information check out the following URL...

    http://whatis.techtarget.com/WhatIs_Definition_Page/0,4152,214225,00.html

    If I can would appreciate if someone could describe what is involved ie: do I create the menu with its javascript etc on a seperate page say called navbar.html and then place in my index.shtml page <!--#include="/navbar.html"-->. How do you make sure it gets placed exactly where you want it? Is the call placed inside a table or would the call no matter where it is entered in the body of your page place the menu in the exact place that it is on the navbar.html page. Is it possible to get this to preload first and place the rollover images into cache?
    The INCLUDE comment tag is just replaced by whatever is in the file you want to include. It's not placed inside a table or anything like that. It just sticks in whatever is in the "navbar.html" file in this case in place of the tag.

    Are there any pros and cons to this. I know it helps if you change the menu names but what about downsides.
    It might slow down loading time by a few milliseconds at most.

    Last does anyone know of any good sites to read up on this SSi function. I did some searchs and found very little that seemed to help
    I could have sworn that there were a few tutorials at HTML Goodies about SSI, but I can't find them.

  3. #3
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here is a quite useful SSI tutorial i wrote, that should help you. If it doesn't just let me know:

    http://www.petestech.com/auth/ssi/ssitut_00.shtml

    Pete

  4. #4
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just make a static page, then cut out the navigation bar HTML, and paste it to another file, it doesn't need the <html> tags, etc. And in the original doc, put in <!--#include="blah-->

    Do the same with the preload script.

  5. #5
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ONly a few cons and pros:

    Pros:

    Easier...much easier...easier than frames

    Cons:

    Can slow server down slightly
    If you have the server parse files with a html ending then it will slow system allot. Make sure in your htaccesss file that it only parses .shtml files unless you want otherwise...

    Peter

  6. #6
    SitePoint Addict gthorley's Avatar
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    BC Thanks for placing this thread where it belongs. I didn't actually mean to put it where I did. Sitepoint was sooo sloww this afternoon that I had 3 browser pages open at different forums flipping back and forth as they loaded and lost track of where I was I guess. Is it my ISP or are Sitepoints servers getting bogged down? I noticed this occurring a lot over the past 3 days.

    I have tried some tests to accomplish this SSI routine but couldn't get them to work and am rethinking it anyway. I am not sure in this instance there is any practical reason to use server side. It won't make pages load any quicker and puts more load on the server I'm on. I guess if everybody did that it would start to bog things down. I think I am better just to use a template as the chance that anything on the Nav bar would change are slim.

    One thing that interests me though is the javascript preload of images. Once these are loaded do they stay in the browsers cache making subsequent pages that use them load quicker?

  7. #7
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would use server side includes the speed difference is in nano seconds. Do you know if your server allows you to have SSI?

    if so then:
    <!--#include file="navig.html" -->

    or

    <!--#include virtual="/includes/navig/navig.html" -->

    File is linking from same directory and virtual is linking from as if you were at the start of a directory. You cannot use a: http://www.example.com/navig.html in an include.

    Did you name the file that you was the includer .shtml and did you remove the:

    <html><head>etc down to
    <body


    and the </body></html> tags? It is a very good idea to.

    Did you upload the files. It will not work if you are trying to see them work off your own computer.

    Do you have a .htaccess file?
    Does it have the correct information inside it?

    Are you using dreamweaver?

    Peter

  8. #8
    SitePoint Addict gthorley's Avatar
    Join Date
    Oct 2000
    Location
    Canada
    Posts
    392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by petesmc

    Did you name the file that you was the includer .shtml and did you remove the:

    <html><head>etc down to
    <body


    and the </body></html> tags? It is a very good idea to.

    Did you upload the files. It will not work if you are trying to see them work off your own computer.

    Do you have a .htaccess file?
    Does it have the correct information inside it?

    Are you using dreamweaver?

    Peter
    I am using dreamweaver and it showed all kinds of errors and that is when I quit on it. They were probably related to the <html> <head> that you mentioned. SSI is on the server as I use it to load a counter script. So looking at the above if I am loading the navig.html file into index.shtml I should remove

    <html>
    <head>
    <script language="JavaScript">
    "Javascript coding etc"
    </script>

    </html>
    </head>

    What about the title and meta stuff that is in that section?

  9. #9
    <? echo "Kick me"; ?> petesmc's Avatar
    Join Date
    Nov 2000
    Location
    Hong Kong
    Posts
    1,508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You only remove the html, heda...etc stuff from the navig.html file

    Everything from navig.html only have from after <body> - </body> not including the body tgags

    All meta stuff sghould be in .shtml file


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •