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

trouble with cfinclude within CFBuilder

New Here ,
Mar 24, 2010 Mar 24, 2010

This seems like the silliest question but I cannot for the life of me get a cfinclude tag to work within my application in CFBuilder.  I always get the standard "cannot find" CF error displayed instead.

I'm on OS X.  Document root is /Applications/ColdFusion9/wwwroot/site and my web root is /Applications/ColdFusion9/wwwroot

It doesn't matter if I reference any of the following, my "includes" folder is not found.

/Applications/ColdFusion9/wwwroot/site/includes

/site/includes

includes (relative)

If I put a file in the includes folder and preview it it displays without a problem.  The file outputs the following information when I use cgi.CF_Template_Path:

/Applications/ColdFusion9/wwwroot/site/includes/location-test.cfm

I've tried deleting the server instance in CFB and adjusting document/web root settings to no avail.

What am I missing (feeling pretty stupid )?  Seems like the CFINCLUDE tag just doesn't work on my local server.

Thanks in advance,
Scott

TOPICS
Builder
635
Translate
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
New Here ,
Mar 25, 2010 Mar 25, 2010

After some more troubleshooting I've narrowed down my problem to something that works currently on a CF7 box.

<cfinclude template="<cfoutput>#application.pathtoroot#</cfoutput>includes/body_header.cfm">

If I remove the <cfoutput>#application.pathtoroot#</cfoutput> the file is included properly.

#application.pathtoroot# allows me to develop on a server where the site can't start in the web root directory and in this case = "/site/".

While the above code with <cfoutput> in the template attribute of the cfinclude throws an error, the following does not so I know it's not a path issue.

<cfinclude template="/site/includes/body_header.cfm">

The error message displays the proper path when saying it cannot locate the included file "Could not find the included template /site/includes/body_header.cfm."

I also tried changing the scope from application. to mysettings. and the error still occurs.

Looks like the problem was the cfinclude tag no longer needs <cfoutput> tags wrapped around the pathtoroot variable I had set.  I knew it had to be a stupid problem!

Translate
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
LEGEND ,
Mar 25, 2010 Mar 25, 2010

As far as I know one has never been able to embed one CF tag within another one.

And certainly having <cfoutput> there is meaningless, because you're not OUTPUTTING that variable; you're just using it.

--

Adam

Translate
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
New Here ,
Mar 25, 2010 Mar 25, 2010
LATEST

Ahh, ok.  I guess a more correct statement would have been "no longer allowed/tolerated"

Translate
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