SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2000
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Variables in Server Side Includes

    Hey all,

    I built a template for a client, and am trying to make updates as easy as possible for me or whoever the webmaster may be. So, I thought that I would use server side includes for the header and footer. However, the image with the page title is in a table, and is much "higher" than the content. So, I thought I would use variables in SSI. Here's what I came up with:
    Code:
    <!--#set var="which" value="blah.blah" --
    <!--#echo $which-->
    However, nothing appears on the screen when I try to run this code. Where am I wrong? Also, can I do the same thing to output attributes to other tags (i.e. <IMG SRC="[variable here]">)?

    Thank you,
    -Corbb
    Corbb O'Connor
    Looking for quality website design or database programming?
    Contact me for more information and a FREE quote!

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So if I understand you, you're saying the that image doesn't show up because it is higher in the directory structure than the page it's being dispalyed on?

    The call to the image must be relative to the page that calls the include as that is where the image will live. Remember that the SSI is processed before any calls for other files are handled.

    So SSI first, then images, javascript, flash etc. Try changing the path to the image to be relative to your main page and see if that works.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Evangelist
    Join Date
    Dec 2000
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    creole,

    Sorry for the confusion. I just meant that my code looks like this:
    Code:
         <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
         <tr height="8">
             <td><img src="images/layout/blank.gif" height="8" width="1" alt="Spacer" border="0"></td>
         </tr>
         <tr height="35">
             <td><img src="images/layout/headers/clients.gif" height="35" width="620" alt="Client List" border="0"></td>
         </tr>
         <tr>
             <td background="images/layout/content-bg.gif" valign="top">
              <table width="100%" cellspacing="0" cellpadding="5" border="0">
              <tr>
                  <td bgcolor="#FFFFFF" background="images/layout/content-bg.gif" valign="top">
                   <!-- ******************************* -->
                   <!-- *   BEGIN MAIN CONTENT AREA   * -->
                   <!-- ******************************* -->...
    See where it says "clients.gif"? That's the image that has the title of the page. Instead of including this big table in every page, I want to use SSI variables to print out the name of the image. The variables would then be defined at the top of the individual pages.

    So, my question is: what's wrong with the original code I posted?

    Thanks,
    -Corbb
    Corbb O'Connor
    Looking for quality website design or database programming?
    Contact me for more information and a FREE quote!


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
  •