Skip to main content
oskark29302609
Participant
November 22, 2017
Answered

SSI (Server side include) not displayed.

  • November 22, 2017
  • 2 replies
  • 2150 views

Hey, Im trying to make a separate file for a global navigation bar using Server Side Includes in Dreamweaver cc 2018.

When I preview my index.html file I get the menu that I included, but if I try to use it to get to another page like "About Us" it doesn't appear on the new page... However if I click "preview in browser" for the About Us page, the menu apears again...

Is it a problem that all my files have the ending .html?

Or is it something that will happen in DW but wont happen when I uploade my site?

This topic has been closed for replies.
Correct answer Nancy OShea

Is your server configured to parse includes in SHTML files?

I seem to remember that I had to configure it myself in WAMP and on my remote server.  

I so rarely use SHTML files, I do everything in PHP now.   PHP includes and .php files.

2 replies

Nancy OShea
Community Expert
Community Expert
November 22, 2017

By your description, it would seem you're previewing locally with Temporary Files.  Thus when you preview the page directly, you see the includes but you don't see includes when navigating to other pages.

Nancy O'Shea— Product User & Community Expert
oskark29302609
Participant
November 22, 2017

Thats right!

Does that mean that this wont be a problem when i upload the site to my webhost/webhotel?

Nancy OShea
Community Expert
Nancy OSheaCommunity ExpertCorrect answer
Community Expert
November 22, 2017

Is your server configured to parse includes in SHTML files?

I seem to remember that I had to configure it myself in WAMP and on my remote server.  

I so rarely use SHTML files, I do everything in PHP now.   PHP includes and .php files.

Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
Community Expert
November 22, 2017

If you are using...

<!--#include file="included.html" -->

...all of your pages that have an include on them should end in .shtml

If you are using...

<?php include 'path-to-include-file.php';?>


...all of your pages that have an include on them should end with .php

Either way, you should set up a local testing server in DW to handle the includes for you during development.

oskark29302609
Participant
November 22, 2017

Thanks! I did that, but now I dont get the include at all...

I made a php MySQL server and put it in the "www" folder in wamp.

my index.shtml file looks like this:

<!doctype html>

<html>

<head>

<title>Name</title>

<link rel="stylesheet" href="styles.css">

</head>

<body>

<!--#include file="menu.html"-->

hello world!

</body>

</html>

and my menu.html file looks like this:

<ul>

<li><a href="index.shtml">Home</a></li>

<li><a href="geologyngeophysics.html">Geology & Geophysics</a></li>

<li><a href="exploration.html">Exploration</a></li>

<li><a href="fieldncourses.html">Fieldwork & Courses</a></li>

<li><a href="researche.html">Researche</a></li>

<li><a href="management.html">Management</a></li>

<li><a href="aboutus.html">About Us</a></li>

</ul>