Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts

    SSI: Navigation Menu Links

    Will someone please tell me what I am doing wrong here?


    With the below code, my nav menu is showing both linked and unlinked items next to each other, whether I am on the page or not. So it looks like this on each page:

    Home Home
    Services and Pricing Services and Pricing
    Downloads Downloads

    Code:
    <body>
      <!--#if expr="\"$DOCUMENT_URI\" = \"/content_copy.shtml\""-->
    Home
    <!--#else-->
    <a href="content_copy.shtml">Home</a>
    <!--#endif-->
    <br />
      <!--#if expr="\"$DOCUMENT_URI\" = \"/services.shtml\""-->
    Services and Pricing
    <!--#else-->
    <a href="services.shtml">Services and Pricing</a>
    <!--#endif-->
    <br />
        <!--#if expr="\"$DOCUMENT_URI\" = \"/downloads.shtml\""-->
    Downloads
    <!--#else-->
    <a href="downloads.shtml">Downloads</a>
    <!--#endif-->
    <br />
    <a href="http://www.facebook.com/gregscomputerworks" target="_blank">Facebook Page</a>
    <br />
      <!--#if expr="\"$DOCUMENT_URI\" = \"/contact.shtml\""-->
    Contact Greg
    <!--#else-->
    <a href="contact.shtml">Contact Greg</a>
    <!--#endif-->
    
      </body>
    Please help!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Sorry, your question is not clear.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Sorry...

    My nav menu is showing double items with that code (it looks exactly the same on every page I navigate to...Home, Services and Pricing, Downloads):


    Home Home
    Services and Pricing Services and Pricing
    Downloads Downloads

    ...but I want it to look like this (when on the Home page):

    Home
    Services and Pricing
    Downloads

    Hope that helps...
    Last edited by gmag73; 02-06-2012 at 03:15 PM. Reason: Fixed syntax

  • #4
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,228
    Thanks
    10
    Thanked 270 Times in 269 Posts
    Looks like it would do that if none of your code was interpreted through SSI (ie, if all those html comments were just treated as comments). Is the file you're processing named something.shtml, and have you verified SSI is actually working on the server?

    Dave

  • Users who have thanked tracknut for this post:

    gmag73 (02-07-2012)

  • #5
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tracknut View Post
    Looks like it would do that if none of your code was interpreted through SSI (ie, if all those html comments were just treated as comments). Is the file you're processing named something.shtml, and have you verified SSI is actually working on the server?

    Dave
    Good eye...I'll bet you're right. I do know SSI is working on the server, so I will check the file extensions. Thanks.

    EDIT: Nope, file types look ok to me. I even skipped the "include file" command and pasted the code directly into the .shtml (it WAS part of a .txt that was referenced with the "include file" SSI command). The Nav bar I am using as an SSI is a cell in a table in the main .shtml doc...would that have any effect?
    Last edited by gmag73; 02-07-2012 at 05:13 AM. Reason: Tried it out

  • #6
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,228
    Thanks
    10
    Thanked 270 Times in 269 Posts
    Can you give us a link to the actual live web page?

    Dave

  • #7
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tracknut View Post
    Can you give us a link to the actual live web page?

    Dave
    Sure thing...

    http://www.gregscomputerworks.com/content_copy2.shtml

    Note that the links in the left Nav bar do not work yet, as I have not uploaded those target pages (the shtml versions), but the links in the main body do work.

  • #8
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,228
    Thanks
    10
    Thanked 270 Times in 269 Posts
    Well I see three things right off...
    1. you have multiple html pages glued together here, repeating things like doctype, <body> etc. I think your included navigation code has all that in there, and it can't. So that stuff needs to be pulled out.
    2. Clearly SSI is NOT interpreting the various comments, I'm not exactly sure why
    3. You have a missing ">" here:
    Code:
      <div align="center"><img src="Frustrated 145x175.jpg" width="100%" alt="Frustrated" title="" border="0" />
      <img src="Help 146x65.jpg" width="100%" alt="Help!" title="" border="0" /></div>
    Maybe one of those will fix it...
    Dave

  • #9
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tracknut View Post
    Well I see three things right off...
    1. you have multiple html pages glued together here, repeating things like doctype, <body> etc. I think your included navigation code has all that in there, and it can't. So that stuff needs to be pulled out.
    2. Clearly SSI is NOT interpreting the various comments, I'm not exactly sure why
    3. You have a missing ">" here:
    Code:
      <div align="center"><img src="Frustrated 145x175.jpg" width="100%" alt="Frustrated" title="" border="0" />
      <img src="Help 146x65.jpg" width="100%" alt="Help!" title="" border="0" /></div>
    Maybe one of those will fix it...
    Dave
    Thanks for the pointers. There are 3 separate documents being pooled to make this webpage, so that's why it looks like so many tags are doubled...the "view source" is pulling them all:

    One document is the left column of the table, and that document is targeting via SSI the second document for the nav menu, and the third document is the second column of the table.

    I don't know what I am doing apparently lol...back to frames I guess

  • #10
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,228
    Thanks
    10
    Thanked 270 Times in 269 Posts
    Ack, no, not back to frames!

    Just remove all the extraneous code. The net result, after the includes have happened, is a full html page with one body, etc. So in the files that are being included, you only put the literal code you want to include. It isn't a "web page" that you're including, it is a "chunk of code" that you want inserted in a spot.

    Make sense?
    Dave

  • #11
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tracknut View Post
    Ack, no, not back to frames!

    Just remove all the extraneous code. The net result, after the includes have happened, is a full html page with one body, etc. So in the files that are being included, you only put the literal code you want to include. It isn't a "web page" that you're including, it is a "chunk of code" that you want inserted in a spot.

    Make sense?
    Dave
    Oh ok...let me try that...thank you so much for your patience!

  • #12
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Ugh this is frustrating! I did what you said (which makes total sense, btw), but with no change. I (successfully) tested SSI on my host server with this tutorial:

    Make two files. Name the first file mytest.shtml and the second file myssi.txt

    The content of the mytest.shtml is:

    <html><body>It goes here.
    <!--#include file="myssi.txt"-->
    </body></html>
    The content of the myssi.txt is:

    <font size="+2">
    <b>Here I am!</b>
    </font>
    Upload those two files to your server and put the URL of mytest.html into your browser. If you see the words "It goes here. Here I am!", then you can use SSI on your server.


    You can see the successful result here:
    http://www.gregscomputerworks.com/mytest.shtml

    Still no change athttp://www.gregscomputerworks.com/content_copy2.shtml, though

  • #13
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,228
    Thanks
    10
    Thanked 270 Times in 269 Posts
    I've been doing a bit of reading on SSI (I don't use it, personally), and noticed that the "control directives" (the #if and #set) are not part of the original SSI, but are an extension called XSSI provided in Apache v1.2+ servers. Do you know what server you're running?

    Dave

  • #14
    New to the CF scene
    Join Date
    Feb 2012
    Posts
    9
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I sure don't but I will find out. Would you be willing to go to www.gregscomputerworks.com, and tell me how I can get a similar layout without frames?

    Thanks so much!
    Greg

  • #15
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,228
    Thanks
    10
    Thanked 270 Times in 269 Posts
    Quote Originally Posted by gmag73 View Post
    I sure don't but I will find out. Would you be willing to go to www.gregscomputerworks.com, and tell me how I can get a similar layout without frames?

    Thanks so much!
    Greg
    PHP, that's what all the cool guys use

    Your files would be xxxx.php instead of shtml of course, but here's the gist of it:
    <?php
    if ($_SERVER['REQUEST_URI'] == "/content_copy.shtml")
    echo "Home";
    else
    echo '<a href="content_copy.shtml">Home</a>';
    ?>
    Dave
    Last edited by tracknut; 02-08-2012 at 06:45 PM.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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