RE: cfinclude template issues
Scott, I would suggest doing Mark's first suggestion. Then open the page using a product that 'used' to work (or still does work). And write down the EXACT value that is displayed for GetPageContent.PageInclude. Then compare that value to the one that is generated when you try to open your new page (that doesn't work). I am guessing that the value in the database for the working page has no initial '/' symbol, while the value for the not working page has that '/' symbol. William -Original Message- From: Scott Weber [mailto:swe...@thanksal.com] Sent: Thursday, February 19, 2009 2:20 PM To: cf-talk Subject: RE: cfinclude template issues All existing pages work. I'm just copying the way he did it on the old pages. I add an entry into the DB and point it to this file which is in the same sub folder as the other working ones. I added that code and on the working pages, nothing happened. On the new page I added I got the same debug message at the bottom like I posted previously. I will try your second option and see, but like I said all other pages are working. -Original Message- From: Gaulin, Mark [mailto:mgau...@globalspec.com] Sent: Thursday, February 19, 2009 3:52 PM To: cf-talk Subject: RE: cfinclude template issues Hi Scott After your , add this to see exactly what the query is returning: The first line will dump the query (or any variable, which is very handy), and cfabort will end the page (before the error hits). If the dump doesn't show a column called PageInclude, or if that value doesn't look like a decent template name, then this query (or something) is the problem. (Remove the debugging code when you're done.) If the query looks right then add a simple and hard-code the query's value as the template. Follow this by and your page should do the cfinclude and then stop; if you get an error then the template you are trying to include is either missing or not reachable from your page. (You can put this tag near the top of the page... All you want to verify is that cfinclude works or doesn't. Remove the cfinclude after the test.) Post your results. Thanks ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319586 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfinclude template issues
On Thu, Feb 19, 2009 at 2:51 PM, Scott Weber wrote: I guess I now know more about CF then I did yesterday... > That's a good thing :) -- I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319563 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: cfinclude template issues
No problem, this is a good list so feel free to ask more questions. -- Josh -Original Message- From: Scott Weber [mailto:swe...@thanksal.com] Sent: Thursday, February 19, 2009 2:52 PM To: cf-talk Subject: RE: cfinclude template issues I got it all figured it and im pretty much a dumb azz... Sorry for the interruption.. It's all my fault. I guess I now know more about CF then I did yesterday... Scott -Original Message- From: Gaulin, Mark [mailto:mgau...@globalspec.com] Sent: Thursday, February 19, 2009 3:52 PM To: cf-talk Subject: RE: cfinclude template issues Hi Scott After your , add this to see exactly what the query is returning: The first line will dump the query (or any variable, which is very handy), and cfabort will end the page (before the error hits). If the dump doesn't show a column called PageInclude, or if that value doesn't look like a decent template name, then this query (or something) is the problem. (Remove the debugging code when you're done.) If the query looks right then add a simple and hard-code the query's value as the template. Follow this by and your page should do the cfinclude and then stop; if you get an error then the template you are trying to include is either missing or not reachable from your page. (You can put this tag near the top of the page... All you want to verify is that cfinclude works or doesn't. Remove the cfinclude after the test.) Post your results. Thanks Mark -Original Message- From: Scott Weber [mailto:swe...@thanksal.com] Sent: Thursday, February 19, 2009 4:23 PM To: cf-talk Subject: cfinclude template issues First, I have no clue about CF. We had a developer make a site in CF and now he is gone. I'm simply trying to add a new page to the existing site and it does not work. Here is the response that I get: Could not find the included template /products/bf.cfm. Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for the path using the ColdFusion Administrator. Or, you can use per-application settings to specify mappings specific to this application by specifying a mappings struct to THIS.mappings in Application.cfc. Using relative paths (for example, template="index.cfm" or template="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible. The error occurred in D:\inetpub\wwwroot\server.com\products\index.cfm: line 101 101 : If I look at the template #GetPageContent.PageInclude# it goes to this: SELECT * FROM dbo.ProductPages WHERE PageID = '#URL.p#' which is at the top of the index.cfm file. All other pages that were made this way work, except any new ones I create. I have to be missing something that is not making this work.. Any ideas on where I can start looking? thanks ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319562 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfinclude template issues
I got it all figured it and im pretty much a dumb azz... Sorry for the interruption.. It's all my fault. I guess I now know more about CF then I did yesterday... Scott -Original Message- From: Gaulin, Mark [mailto:mgau...@globalspec.com] Sent: Thursday, February 19, 2009 3:52 PM To: cf-talk Subject: RE: cfinclude template issues Hi Scott After your , add this to see exactly what the query is returning: The first line will dump the query (or any variable, which is very handy), and cfabort will end the page (before the error hits). If the dump doesn't show a column called PageInclude, or if that value doesn't look like a decent template name, then this query (or something) is the problem. (Remove the debugging code when you're done.) If the query looks right then add a simple and hard-code the query's value as the template. Follow this by and your page should do the cfinclude and then stop; if you get an error then the template you are trying to include is either missing or not reachable from your page. (You can put this tag near the top of the page... All you want to verify is that cfinclude works or doesn't. Remove the cfinclude after the test.) Post your results. Thanks Mark -Original Message- From: Scott Weber [mailto:swe...@thanksal.com] Sent: Thursday, February 19, 2009 4:23 PM To: cf-talk Subject: cfinclude template issues First, I have no clue about CF. We had a developer make a site in CF and now he is gone. I'm simply trying to add a new page to the existing site and it does not work. Here is the response that I get: Could not find the included template /products/bf.cfm. Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for the path using the ColdFusion Administrator. Or, you can use per-application settings to specify mappings specific to this application by specifying a mappings struct to THIS.mappings in Application.cfc. Using relative paths (for example, template="index.cfm" or template="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible. The error occurred in D:\inetpub\wwwroot\server.com\products\index.cfm: line 101 101 : If I look at the template #GetPageContent.PageInclude# it goes to this: SELECT * FROM dbo.ProductPages WHERE PageID = '#URL.p#' which is at the top of the index.cfm file. All other pages that were made this way work, except any new ones I create. I have to be missing something that is not making this work.. Any ideas on where I can start looking? thanks ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319560 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: cfinclude template issues
All existing pages work. I'm just copying the way he did it on the old pages. I add an entry into the DB and point it to this file which is in the same sub folder as the other working ones. I added that code and on the working pages, nothing happened. On the new page I added I got the same debug message at the bottom like I posted previously. I will try your second option and see, but like I said all other pages are working. -Original Message- From: Gaulin, Mark [mailto:mgau...@globalspec.com] Sent: Thursday, February 19, 2009 3:52 PM To: cf-talk Subject: RE: cfinclude template issues Hi Scott After your , add this to see exactly what the query is returning: The first line will dump the query (or any variable, which is very handy), and cfabort will end the page (before the error hits). If the dump doesn't show a column called PageInclude, or if that value doesn't look like a decent template name, then this query (or something) is the problem. (Remove the debugging code when you're done.) If the query looks right then add a simple and hard-code the query's value as the template. Follow this by and your page should do the cfinclude and then stop; if you get an error then the template you are trying to include is either missing or not reachable from your page. (You can put this tag near the top of the page... All you want to verify is that cfinclude works or doesn't. Remove the cfinclude after the test.) Post your results. Thanks ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319558 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: cfinclude template issues
Hi Scott After your , add this to see exactly what the query is returning: The first line will dump the query (or any variable, which is very handy), and cfabort will end the page (before the error hits). If the dump doesn't show a column called PageInclude, or if that value doesn't look like a decent template name, then this query (or something) is the problem. (Remove the debugging code when you're done.) If the query looks right then add a simple and hard-code the query's value as the template. Follow this by and your page should do the cfinclude and then stop; if you get an error then the template you are trying to include is either missing or not reachable from your page. (You can put this tag near the top of the page... All you want to verify is that cfinclude works or doesn't. Remove the cfinclude after the test.) Post your results. Thanks Mark -Original Message- From: Scott Weber [mailto:swe...@thanksal.com] Sent: Thursday, February 19, 2009 4:23 PM To: cf-talk Subject: cfinclude template issues First, I have no clue about CF. We had a developer make a site in CF and now he is gone. I'm simply trying to add a new page to the existing site and it does not work. Here is the response that I get: Could not find the included template /products/bf.cfm. Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for the path using the ColdFusion Administrator. Or, you can use per-application settings to specify mappings specific to this application by specifying a mappings struct to THIS.mappings in Application.cfc. Using relative paths (for example, template="index.cfm" or template="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible. The error occurred in D:\inetpub\wwwroot\server.com\products\index.cfm: line 101 101 : If I look at the template #GetPageContent.PageInclude# it goes to this: SELECT * FROM dbo.ProductPages WHERE PageID = '#URL.p#' which is at the top of the index.cfm file. All other pages that were made this way work, except any new ones I create. I have to be missing something that is not making this work.. Any ideas on where I can start looking? thanks ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319555 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: cfinclude template issues
CF uses / to indicate a "mapping" (an alias to a specific location). by default, the "/" alone is a mapping to the web root. in the CF Admin, you can set up additional mappings, such that /products could point to c:\inetpub\wwwroot\foo\bar\products since you're using /products/bf.cfm, unless there is a mapping set up for /products, that would look in your web root for a folder called 'products' and a file inside called 'bf.cfm'. if you're using a mapping (either in the Admin or, if you're on CF 8 it could be in the Application.cfc), you'd need to see what the mapping for '/products' points to (and then look in that location for 'bf.cfm'). On Thu, Feb 19, 2009 at 1:22 PM, Scott Weber wrote: > > First, I have no clue about CF. We had a developer make a site in CF and > now he is gone. I'm simply trying to add a new page to the existing site > and it does not work. > > Here is the response that I get: > Could not find the included template /products/bf.cfm. > Note: If you wish to use an absolute template path (for example, > template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for > the path using the ColdFusion Administrator. Or, you can use per-application > settings to specify mappings specific to this application by specifying a > mappings struct to THIS.mappings in Application.cfc. > Using relative paths (for example, template="index.cfm" or > template="../index.cfm") does not require the creation of any special > mappings. It is therefore recommended that you use relative paths with > CFINCLUDE whenever possible. > > The error occurred in D:\inetpub\wwwroot\server.com\products\index.cfm: > line 101 > > 101 : bgcolor="#5E5E5E"> > > If I look at the template #GetPageContent.PageInclude# it goes to this: > > SELECT * > FROM dbo.ProductPages > WHERE PageID = '#URL.p#' > > which is at the top of the index.cfm file. > > All other pages that were made this way work, except any new ones I create. > I have to be missing something that is not making this work.. > > Any ideas on where I can start looking? > > thanks > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319554 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: cfinclude template issues
You need to add the filename of the page you're adding to the PageInclude column of the database table (dbo.ProductPages), and a then pass the pageID code of the new item to index.cfm (index.cfm?p=[PageID]). On second glance, it looks like you may have already done this part--your message says it cannot find /products/bf.cfm. Maybe the file you created needs to be in a different location in the file system? You'll also probably want to wash the URL param p before passing it into your database, using cfqueryparam, otherwise you subject yourself to SQL injection attacks. SELECT * FROM dbo.ProductPages WHERE PageID = On Thu, Feb 19, 2009 at 3:22 PM, Scott Weber wrote: > > First, I have no clue about CF. We had a developer make a site in CF and > now he is gone. I'm simply trying to add a new page to the existing site > and it does not work. > > Here is the response that I get: > Could not find the included template /products/bf.cfm. > Note: If you wish to use an absolute template path (for example, > template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for > the path using the ColdFusion Administrator. Or, you can use per-application > settings to specify mappings specific to this application by specifying a > mappings struct to THIS.mappings in Application.cfc. > Using relative paths (for example, template="index.cfm" or > template="../index.cfm") does not require the creation of any special > mappings. It is therefore recommended that you use relative paths with > CFINCLUDE whenever possible. > > The error occurred in D:\inetpub\wwwroot\server.com\products\index.cfm: > line 101 > > 101 : bgcolor="#5E5E5E"> > > If I look at the template #GetPageContent.PageInclude# it goes to this: > > SELECT * > FROM dbo.ProductPages > WHERE PageID = '#URL.p#' > > which is at the top of the index.cfm file. > > All other pages that were made this way work, except any new ones I create. > I have to be missing something that is not making this work.. > > Any ideas on where I can start looking? > > thanks > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:319553 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4