Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Can use INCLUDE to pull formatted ttext or does it have to be plain txt.

Can use INCLUDE to pull formatted ttext or does it have to be plain txt.
Thread Tools
Mac Elite
Join Date: Jun 2001
Location: NYNY
Status: Offline
Reply With Quote
May 8, 2002, 10:30 AM
 
I used this line below to pull text from an external file and worked great.

------------> < !--#include file="sample.txt"-->

Does anyone know if I can format or delimit that text in anyway or does it have to be just plain txt.
"Well done is better than well said." -BF
Commercial Range
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
May 8, 2002, 10:53 AM
 
The server doesn't care what format the file is in. And the browser doesn't even know that you included anything; it all looks like one big HTML file. So if your included file has HTML code in it, the browser will render it just like any other HTML code.

Just make sure that once all your includes are all in place, the code still validates.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Mac Elite
Join Date: Jun 2001
Location: NYNY
Status: Offline
Reply With Quote
May 8, 2002, 12:16 PM
 
Originally posted by Millennium:
<STRONG>The server doesn't care what format the file is in. And the browser doesn't even know that you included anything; it all looks like one big HTML file. So if your included file has HTML code in it, the browser will render it just like any other HTML code.

Just make sure that once all your includes are all in place, the code still validates.</STRONG>
Thanks

I'm trying to set it up so a client can update certain sections of the site themselves, hopefully by simply uploading a document that would overwrite the existing document that is being included.

assuming they only have MS Word to work with..could they save the document as sample.rtf for instance or sample.html and retain the formatting they have applied to the document?
"Well done is better than well said." -BF
Commercial Range
     
Professional Poster
Join Date: Oct 2000
Location: Toronto, ON
Status: Offline
Reply With Quote
May 8, 2002, 03:51 PM
 
It has to be plain text or HTML, not RTF.
So yes, they could take their Word document, Save As HTML, and put it on the server, and you include would work (provided the include command matched the document filename, obviously). The only thing is that Word makes absolutlely crappy HTML from its Save As command, and the newer versions are worse than ever, including custom stylesheets and XML commands. These may screw up the rest of your page, only experimentation will tell you if it does or not.
The Lord said 'Peter, I can see your house from here.'
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
May 8, 2002, 04:22 PM
 
Originally posted by ReggieX:
<STRONG>It has to be plain text or HTML, not RTF.
So yes, they could take their Word document, Save As HTML, and put it on the server, and you include would work (provided the include command matched the document filename, obviously). The only thing is that Word makes absolutlely crappy HTML from its Save As command, and the newer versions are worse than ever, including custom stylesheets and XML commands. These may screw up the rest of your page, only experimentation will tell you if it does or not.</STRONG>
Actually, it's even worse than that. The Save As HTML command in basically any editor out there at the moment saves as a complete HTML page. This isn't what you want; an include file should contain HTML fragments (only rarely do you really want to include a full HTML file).
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Fresh-Faced Recruit
Join Date: Mar 2002
Location: Brisbane, Australia
Status: Offline
Reply With Quote
May 9, 2002, 09:00 PM
 
But do the extra html codes cause any problems. We are running IIS and some of the include pages are full html files and I haven't seen any probs.
_ _ _______ _ _
is this where the signature goes?
     
Mac Elite
Join Date: Mar 2001
Status: Offline
Reply With Quote
May 15, 2002, 08:00 PM
 
That's usually fine if you have full html pages within html.

Also, if you have ASP code in your text file then make sure you have the <% and %> tags completely within the text file. You should name the files .asp just in case someone pulls up the file by itself - your server won't spill the guts of the logic - just the results.

If you're not using ASP then don't worry about anything I said cause it won't apply.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:00 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2