Click here to Skip to main content
13,056,229 members (106,785 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a formatted string that contains a description of an item (I'm using an extended RFT Editor then converting to HTML). I want to then insert that description into another field that contains HTML. I imagined using a placeholder of some sort in the HTML, but I'd be happy with another solution.

For example in pseudo html:

The RTF formatted string will be converted to HTML, but the location of the insertion may change if I alter the HTML so using indexes etc is probably out.

The result will be a HTML template common to all records with placeholders, which is then used to build the display with the specific description embedded in the proper place for each record whe I upload to my website.

Any ideas on how to do this? I considered doing a straight find replace but wanted to know if there's a better way?
Posted 24-Apr-14 23:27pm
gggustafson 25-Apr-14 13:05pm
Have you considered using a class (and possibly an id) in your HTML for the placeholders? That way you do not rely on indices. I wrote an article Revised Green Links that does that.
Member 10773666 26-Apr-14 10:17am
Thanks for the fast response GG. I had a look at your green links article, but thats not what I want to do. Basically I am looking for a way to template a webpage and insert an items description (in HTML) in to the page. After reading your green links article I looked also at your master pages one with javascript and that one might do the trick. I'll have a p[lay with it and see if it will work. I don't have control of the page when it is uploaded, so they might not allow javascript to make cross domain calls, since I can't add the header and footer text files to the site. It gives me a good idea of where to start anyway :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170728.5 | Last Updated 25 Apr 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100