Welcome to Dream.In.Code
Click Here
Getting Help is Easy!

Join 117,572 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,855 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Help: Replace string with template result

 
Reply to this topicStart new topic

Help: Replace string with template result

susan10
post 14 Dec, 2007 - 10:08 AM
Post #1


New D.I.C Head

*
Joined: 14 Dec, 2007
Posts: 1


My Contributions


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?
User is offlineProfile CardPM

Go to the top of the page


dswens
post 15 Dec, 2007 - 12:12 PM
Post #2


New D.I.C Head

*
Joined: 16 Oct, 2007
Posts: 34


My Contributions


Is ColdFusion giving you an error message? If so, what, if not, what is happening?
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 08:31PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month