- Post ID 202892

User 467079 Photo


Registered User
2 posts

I have some html code that runs ok, but want to put it into an include file. It executes in the shtml file, but does nothing in the include file. I have not done this, any one have any examples or what I need in the include file to make it work. I need help please.
User 187934 Photo


Senior Advisor
20,247 posts
Online Now

Are you trying to do a java script include?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 122279 Photo


Senior Advisor
14,571 posts
Online Now

By the looks of it, you are trying to use SSI.

The rule of thumb is:
If the file to be included is in the same folder as the file that calls it, you use
<!--#include file="included.html" -->

If, however, the included file is in another folder, the syntax is
<!--#include virtual="/directory/included.html" -->


The 'included.html' can also be a .txt file. I used to have the 'main file', the one that calls the includes, as a .shtml file, but it may be possible to use just .html, it depends on your server.

Of course you will have to upload the files in order to test them, unless you have wamp, xamp, winamp or one of these server packets installed.

SSI is actually a pretty old way of including content from one file into another, nowadays php includes are more common.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.