• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFoutput from include(.txt file)

Explorer ,
Feb 15, 2008 Feb 15, 2008

Copy link to clipboard

Copied

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--->
TOPICS
Advanced techniques

Views

516

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Feb 15, 2008 Feb 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.

Votes

Translate

Translate
New Here ,
Feb 15, 2008 Feb 15, 2008

Copy link to clipboard

Copied

The page is not loading......

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 15, 2008 Feb 15, 2008

Copy link to clipboard

Copied

I think your solution is to use CFFILE to read the text file into a variable and then output the variable.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2008 Feb 15, 2008

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation