There is another thread running on this at the moment, see "templates held
in database".

To answer your question though, write the content from your database to a
temporary file using CFFILE, then use <CFINCLUDE> to include that file, then
delete the temporary file...

<CFSET FileName = CreateUUID() & ".cfm">
<CFFILE ACTION="WRITE" FILE="#ExpandPath(FileName)#"
CONTENT="#fromYourDatabase#">
<CFINCLUDE TEMPLATE="#FileName#">
<CFFILE ACTION="DELETE" FILE="#ExpandPath(FileName)#">

Written off the top of my head, those attributes to CFFILE might be wrong.

----- Original Message -----
From: "Picker, Mark" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, June 24, 2002 6:26 PM
Subject: Using CFInclude tag in content being extracted from DB....is it
possible


> Hi,
>
> We are developing a site that has all the page contents stored in a
> database.  Each page has a variable set at the top and an include later
> in the page that calls a page to load content from the database.
>
> This is a page from the site (all are the same as this) :
>
> <cfset PageID = 1>
> <cfset SectionID = 1>
>
> <cfinclude template="header.cfm">
> <cfinclude template="content.cfm">
> <cfinclude template="common/footer.cfm">
>
> and this is the content.cfm page :
>
> <cfquery name="qryGetContent" datasource="#DSN#">
> SELECT tblDocuments.fldDocumentID,
> tblDocuments.fldDocumentTitle, tblDocuments.fldDocumentText
> FROM tblDocuments
> WHERE (tblDocuments.fldDocumentID=#PageID#)
> </cfquery>
>
> <cfoutput query="qryGetContent">
> #Evaluate(DE(fldDocumentText))#
> </cfoutput>
>
> All seems to work ok except if the content coming from the database has
> any coldfusion tags in it.  Functions appear to be ok, just not tags.
> The problem is, some pages has <CFINCLUDE> in them.
>
> This is an extract from a pages contents in the database :
>
>       <img src="/common/images/xparent.gif" width="1" height="1"><br>
>         <cfinclude template="common/nav_related_links.cfm">
>         #now()#
>        </td>
>
> The #now()# is done, and displays date/time etc, but the <cfinclude> tag
> does not do anything and actually appears as code in the source to the
> final page in the browser.
>
>       <img src="/common/images/xparent.gif" width="1" height="1"><br>
> <cfinclude template="common/nav_related_links.cfm">{ts
> '2002-06-24 16:16:26'}
>
>     </td>
>
> Does anybody know how to get around this problem? I need to use the
> <cfinclude> that is in the database content.
>
> Regards,
>
> Mark Picker
> Internet Manager
> Western Institute of TAFE - Dubbo
> Direct Line : (02) 6885 7538
> Institute Office : (02) 6885 7522
> Fax Number : (02) 6884 3610
>
>
> FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
> Archives: http://www.mail-archive.com/[email protected]/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to