Skip to main content
Inspiring
February 15, 2008
Answered

CFoutput from include(.txt file)

  • February 15, 2008
  • 3 replies
  • 577 views
I'm trying to display some content from a file as an include but it is not working, the cf syntax shows up but not the content from the database. Here is what I mean
http://192.168.1.54/~rangeles/web/realdads/rd_pages.cfm?sectid=1&pageid=1&articleid=2


<!---Start Page Content--->
<div id="pageoutput">
<cfloop query="contList">
<cfoutput>
<cfinclude template="admin/page_files/#TRIM(page_title)#.txt">
</cfoutput>
</cfloop>
</div>
<!---End Page Content--->
This topic has been closed for replies.
Correct answer reya276
Actually the solutions was adding an extra pair of <cfoutput></cfoutput> in between the tags. Meaning when writing the file, just write the file content this way

<p><cfoutput>#article_title#</cfoutput></p>

<p><cfoutput>#article_cont#</cfoutput></p>

for some reason when done this way CF ignores the <cfoutput query="">

Meaning it brings back the query content but does not perform the output, in this case.

the URL is actually blocked because is on my local PC, sorry.

3 replies

reya276AuthorCorrect answer
Inspiring
February 15, 2008
Actually the solutions was adding an extra pair of <cfoutput></cfoutput> in between the tags. Meaning when writing the file, just write the file content this way

<p><cfoutput>#article_title#</cfoutput></p>

<p><cfoutput>#article_cont#</cfoutput></p>

for some reason when done this way CF ignores the <cfoutput query="">

Meaning it brings back the query content but does not perform the output, in this case.

the URL is actually blocked because is on my local PC, sorry.
Legend
February 15, 2008
I think your solution is to use CFFILE to read the text file into a variable and then output the variable.
Known Participant
February 15, 2008
The page is not loading......