First, I'd recommend not using CF markup for the fields.  Or at least
don't require the CFOUTPUT tags, just the hashes.  If you have a small
number of fields, loop over them and just do a replace(string,
"##detail.firstname##", detail.firstname, "all") for each one.  Not
real elegant, but it is simple.

A more robust solution would be to parse the text for hashes, and then
check the contents of each pair (making sure to gracefully deal with
floating hashes that aren't delimiters) and substituting the right
content in it's place.  This is a lot more complex, because you'll be
doing a seek/cut/insert loop, rather than just replacing content, but
it allows for a lot more flexibility.

cheers,
barneyb

On 8/25/05, Andy Mcshane <[EMAIL PROTECTED]> wrote:
> Hi all, I am trying to come up with a way to do the following;
> 
> User creates/edits a basic letter/mailshot document on line using FCKeditor.
> 
> Within this document the user can add some pre-defined CF output fields i.e. 
> <cfoutput>#details.firstname#</cfoutput>.
> 
> This is with the idea of trying to do a simple mailshot by extracting the 
> names and addresses required from the database, selecting the letter/mailshot 
> text from the database, looping thorugh the recordset inside of a cfdocument 
> tag and producing a PDF of all the letters.
> 
> The point at which I am stuck is actually replacing the output tags inserted 
> into the original text with the required data from the database before 
> allowing cfdocument to process it. Does anyone have any suggestions/ideas on 
> the best way to replace my tags with the required text?
> 

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216368
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to