1 Replies - 1872 Views - Last Post: 15 December 2007 - 12:12 PM Rate Topic: -----

#1 susan10  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-December 07

Help: Replace string with template result

Posted 14 December 2007 - 10:08 AM

Im new to Coldfusion, and here is what i would like to do:

I'm using a html-editor on one cfm-page, and saving the text in a database:

--mytext written i the html-editor ----------------------

Nunc libero ligula volutpat ac aliquet id laoreet ac lacus.


[peopleoutofoffice]


In dictum tincidunt turpis. Morbi sodales, justo ut posuere viverra
, mi turpis egestas nunc, ac consequat leo elit vitae pede.

---------------------------------------------------------

And showing the text entered in the editor on an other page.


<!-- viewcontent.cfm -->

<cfquery name="pagecontent" datasource="myDB">
Select id, mytext from contenttable
Where id = 5
</cfquery>


<cfoutput query="pagecontent">#mytext#</cfoutput>


... that's very simple!


But, that i want to do is replacing the string; [peopleoutofoffice] in #mytest# with the result of an other cfm template, like this:


<CFOUTPUT>#replace(mytext,"[peopleoutofoffice]", GetOutOfOffice.cfm)#</CFOUTPUT>


<!-- GetOutOfOffice.cfm -->

<cfquery name="OutOfOffice" datasource="myDB">
Select firstname, surname, status from persontable
Where status is "out"
</cfquery>


<table>
<tr>
<td>The following people is out of office</td>
</tr>

<cfoutput query="OutOfOffice">
<tr>
<td>#firstname# #surname#</td>
</tr>
</cfoutput>

</table>

----------------------------------------------------------

How do i solve this problem?

Is This A Good Question/Topic? 0
  • +

Replies To: Help: Replace string with template result

#2 dswens  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 16-October 07

Re: Help: Replace string with template result

Posted 15 December 2007 - 12:12 PM

Is ColdFusion giving you an error message? If so, what, if not, what is happening?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1