Framing Text Files - Post ID 82598

User 1892988 Photo


Registered User
151 posts

Using: VSD

On certain pages I want to create a scrollable text frame. The contents of that frame must be contents of a text file.

So, if I want to update certain information, I just upload the updated text file onto the FTP server and the site will be up-to-date again.

It's even nicer if I can embed HTML codes into the text file to give me formatted results.

Any suggestion?

PS
Using <iframe> gives me the result I want with HTML files but not with .TXT files. (unless I don't know how)

HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com
User 597929 Photo


Registered User
1,332 posts

If you're going to want to imbed HTML in the text file anyway, could you just open the text, format it to taste, then save as HTML using an app like Microsoft Word? I actually did that with a text file I wanted formatted a certain way, and called it with an iframe, and it worked very well.

Example:

http://www.golf1500.com/bylaws_wrapper.htm

ON EDIT: Don't even need to use Word, if you know the HTML you want to add and plan to do it by hand. Just save the result as .html instead of as .txt.
"You can't be a real country unless you have a beer and an airline - it helps if you have some kind of a football team, or some nuclear weapons, but at the very least you need a beer." -- Frank Zappa

Visit Spinland Studios: http://www.spinland.biz
User 1892988 Photo


Registered User
151 posts

Thanks Spinny!

I saw you example in another thread while I did a search before I popped my question.

I saved a Word doc as HTML but I think Word creates the worse possible HTML I ever saw. I rather use nothing.

However, it make sense to put some formatting codes into a text file and save it as a .HTML instead of .TXT. I tried it but it did not work. My browser could not find the HTML file while it was existent. (?)

The file looked like this: (test.html)
<P>
This is a test.<BR>
This is the second line<BR>
</P>

HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com
User 282670 Photo


Registered User
3,940 posts

Hi Dick,
If you have access to html editor then you could do as Spinny had mentioned and place your text in an html file, just use some added coding such as <pre> with some breaks <br /> cause you'll need to size it for the window size you wish to use. It's real easy.
Then using an iframe code, and the add files in VSD it should look something like this.
http://myofficialnewbie.com/VSD/Page1.html
unless you wish to make a full page of it.




User 1892988 Photo


Registered User
151 posts

Thanks, I will play with it a bit.
HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com
User 355448 Photo


Ambassador
3,144 posts

Dick,

Do you have the ability to include files? I use PHP, and you can format everything up to the point where you pull in the text, and then pull in the file.

I know there are other ways to do this, but it should work if you name the text file with a .php extension.

I suggest you get the correct code from someone that really knows php, but what I use looks like this:

<?php include($DOCUMENT_ROOT . "filename.php"); ?>
User 1892988 Photo


Registered User
151 posts

Bear with me Bill for I'm a newbe...

I don't understand your solution. Can you explain?
HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com
User 355448 Photo


Ambassador
3,144 posts

Dick,

If you have PHP available for use with your site, save your text file as filename.php and name your web page with .php instead of .html then you can set up a section of your page with code that looks something like:

<p style="color:#FF0000; ">
<?php include($DOCUMENT_ROOT . "filename.php"); ?>
</p>

I haven't tested this, but it should work.

This may solve one of my issues, so I will try to test tomorrow after I get home.
User 1892988 Photo


Registered User
151 posts

Thanks Bill, I understand now.

I will surely look into it.
HTML Editor, Visual Site Designer, Web Form Builder, Picture Gallery, Fire Starter,
News Reader, Web Access Manager, Password Wizard

asaruba.com
beholdmyvision.com
User 355448 Photo


Ambassador
3,144 posts

Dick,

I just did a test and the text file can be named filename.txt and it will work.

It is possible to use several lines of php code and have several files loaded. If you have someone else loading the text files, you could have them name their files with their name and then call several files of bob.txt, donna.txt, etc.

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.