• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

SSI (Server side include) not displayed.

New Here ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

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?

Views

1.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 22, 2017 Nov 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.

Votes

Translate

Translate
Community Expert ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

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 & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

Thats right!

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

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 & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

I dont know, Ill have to ask my webhoast about that and if they can change the configuration for me.

Otherwise I could do as you and use PHP.

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

If you changed all the file extensions of your pages to .shtml, your links in the code posted above are wrong.

They would need their .html changed to .shtml as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 22, 2017 Nov 22, 2017

Copy link to clipboard

Copied

LATEST

It's not difficult to add the SHTML file type with an .htaccess file.

Enable SSI with .htaccess - Apache .htaccess Guide, Tutorials & Examples

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines