How to Import a Text File in to HTML

Webmaster Training:
Edit a Website by Importing a Text File Into the HTML

Code For Importing Text File Into HTML Code

To import a text file into your html, simply add the following code within the body tag:
<h1>Cool Title Tag!</h1>
<iframe name="Iframe1" src="folder/text.txt">
Your browser does not support inline frames or is currently configured not to
display inline frames.
</iframe>

The process in making a website editable by a person with no knowledge of html is much simpler then what many would think.

Some website owners simply need to edit a small text portion of their site, as opposed to the entire site. The thought of installing a content management system seems over zealous and the idea of trying to train someone on simple html could seem like a burden to a person with no knowledge of html.

What about offering different portions of a website that can be edited by a Text file? Maybe a company would like to change the hours of their business, as well as a new sales pitch, but does not have the time or ability to learn the in’s and out’s of a Content Management System.

In such instances where just a small portion of text needs to be changed the use of a .txt file within your html may make your life and the website simplify the process. Using code that simply adds a .txt file to your html should not even be considered if any of the titles, navigation, images, needs to be changed. Website owner will not have the ability to format text on any level, they will only be adding text to a portion of the website. The code you will be adding will simply import the text from a specific .txt file.

Here is what your site could look like, only the portion highlighted in the color red will be editable:

Import Text File into HTML

Considerations should also be given to the code itself as we are going to use an iframe to import the text file into the html. Some browsers and/or platfrom/os combinations may not support the use of an iframe within a browser.

The greatest thing about linking to a .txt file is simplicity. Training to do as such is minimal. No worries as to a person with no knowledge of html destroying your hard CSS work. They will simply be editing out a pre-defined area of text within the html.

Training is quite simple. The text file will be given a name that should not be changed like “text.txt”. Website owner will change text and save file. Website owner will connect via an FTP client(Filezilla for example) and upload to predesignated folder and location. That’s it! Learning how to use an FTP client is simple and the login information can be saved so that they do not have to remember ftp information. You can even lock down site and give FTP permissions only to the folder where the text file is stored.

Now that I have covered the basics, let me once again offer you the code to import a .txt file into your html.

Code For Importing Text File Into HTML Code

To import a text file into your html, simply add the following code within the body tag.

<h1>Cool Title Tag!</h1>
<iframe name="Iframe1" src="folder/text.txt">
Your browser does not support inline frames or is currently configured not to
display inline frames.
</iframe>

Need help on a web development project? Outsource your work to the USA via Web Design by MikeStratton.net! $12/hr

0
  Related Posts