Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Layout Cells showing text files? 1

Status
Not open for further replies.

Jusenkyo

Programmer
Aug 16, 2002
295
0
0
GB
Hello All

I want to simplify the editing of my site by using text files to store basic content. This content (words, not code) will then be displayed in a layout cell on the site.

I have tried to work out how to do this - to no avail!

Anyone have any ideas???

Cheers
Jusenkyo ;-)
 
Use the code below
Code:
<!--#include virtual=&quot;/folder/include.txt&quot; -->

Cheech

[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks.
 
Cheers for that Cheech... again!

I have instered this code, and chosen the correct file... and I can see the text contained in the file in the design window.

However - when I preview the page in the browser window - the text is not shown!!

Any ideas why?

Cheers
Jusenkyo
 
From F1>search on &quot;includes&quot;>Using server side includes>

About server-side includes
When you open a document that’s on a web server, the server processes the include instructions and creates a new document in which the include instructions are replaced by the contents of the included file. The server then sends this new document to your browser. When you open a local document directly in a browser, however, there’s no server to process the include instructions in that document, so the browser opens the document without processing those instructions, and the file that’s supposed to be included doesn’t appear in the browser. It can thus be difficult, without using Dreamweaver, to look at local files and see them as they’ll appear to visitors after you’ve put them on the server.

With Dreamweaver, though, you can preview documents just as they’ll appear after they’re on the server, both in the Design view and when you preview in a browser.

Placing a server-side include in a document inserts a reference to an external file; it doesn’t insert the contents of the specified file in the current document. Dreamweaver displays the contents of the external file in Design view, making it easier to design pages.

You cannot edit the included file directly in a document. To edit the contents of a server-side include, you must directly edit the file that you’re including. Any changes to the external file are automatically reflected in every document that includes it.

There are two types of server-side includes: Virtual and File. Choose which to use depending on what type of web server you use:

If your server is an Apache web server, choose Virtual. (This is the default choice in Dreamweaver.) In Apache, Virtual works in all cases, while File works only in some cases.
If your server is a Microsoft Internet Information Server (IIS), choose File. (Virtual works with IIS only in certain specific circumstances.) Unfortunately, IIS won’t allow you to include a file in a folder above the current folder in the folder hierarchy, unless special software has been installed on the server. If you need to include a file from a folder higher in the folder hierarchy on an IIS server, ask your system administrator if the necessary software is installed.
For other kinds of servers, or if you don’t know what kind of server you’re using, ask your system administrator which option to use.
Some servers are configured to examine all files to see if they contain server-side includes; other servers are configured to examine only files with a particular file extension, such as .shtml, .shtm, or .inc. If a server-side include isn’t working for you, ask your system administrator if you need to use a special extension in the name of the file that uses the include. (For example, if the file is named canoe.html, you may have to rename it to canoe.shtml.) If you want your files to retain .html or .htm extensions, ask your system administrator to configure the server to examine all files (not just files with a certain extension) for server-side includes. Parsing a file for server-side includes takes a little extra time, though, so pages that the server parses are served a little more slowly than other pages; some system administrators therefore won’t provide the option of parsing all files.


Cheech

[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks.
 
So it was in the help file all along!

Thanks Cheech.

Another question though... how do I make the server look for these server-side includes? I cannot find it on the help on the server (IIS). I dont mind having a .SHTML extension on this one page - but it will involve changing a few links!

Allso - does anyone actually use this method for updating basic content to the website... i.e. A news section - which is stored in a text file, which when changed will change the website allso.

I suppose I could just use contribute - and let people just edit certain sections of the site??

Thanks again ;-)
 
&quot;Look for the files&quot;
have a look here for a good little tutorial.
I tend to use a database backend with a page the user edits the content through, that way you dont have upload permissions or server issues.

Cheech

[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks.
 
Hi All

I have setup header.htm and test.shtm

I want to use ssi to include the header file into test.shtm

<!--#include file="topnav1.htm" -->


But i keep getting this error when I try to add content to the test.shtm page.

Making this change would require changing code that is locked by a template or a translator.The change will be discarded.

Any help would be appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top