Replace Text in a RTF-Field

Hello,

I need to replace a text placeholder in a rft-field with a other rtf or passed HTML in .

Is there a work around how to replace text in RTF-Fields with ather RTF or HTML Text.

I wanna have the possibility to format a whole page for the web and place “PLACEHOLDERS” in this RTF like $$NEWS_OVERVIEW$$. On webqueryopen i would replace the $$NEWS_OVERVIEW$$ with html-source which was created at runtime and contains the current newslist.

With such a solution I could manage the dynamic advantage of News,Guestbooks what ever… in a Fixed design places by sombody who is not able to change designs in HTML

thanks a lot for other solutions

Bernd

Subject: Replace Text in a RTF-Field

There are a couple of different ways to do this, but the most likely to work well would be to use computed text for those placeholders, and compute the text to field names which you could then populate in the WebQueryOpen. I don’t think it would even matter if those fieldnames actually existed on the form, since they would be for display only.

Of course, as soon as we talk about fields and WebQueryOpen, it means we are talking forms, not pages, since pages don’t have WebQueryOpen agents, and you can’t easily store field values on them.

Subject: RE: Replace Text in a RTF-Field

Hello Ben,

What i meant is that I have allready a Form witch I use for display on the web.

This form has only one RTF-Field. Befor and after this field is plane HTML pass-thru-html.

I have a view with news Documents and a news form.

When i display a document throu the Web-Form the document includes this one RTF-Field. The content of a document/RTF-Field could be a table with two columns and one row. In the left column is a place_holder (just text) $$NEWS_OVERVIEW$$.

So everybody can place this $$NEWS_OVERVIEW$$ place holder in a document put some RTF-formation around it and at the web istead of the place holder comes the newsoverview list in HTML source between “[” and “]”

So that is the basic, but how can ic replace the content of a RTF-field in a document which have as content some formats and a word LIKE $$NEWS_OVERVIEW$$ and instead of this $$NEWS_OVERVIEW$$ i will replace it with:

[

News 1
News 2
News 3

]

But i do not know how i can replace a text like $$XYZ_OVERVIEW$$ whith such a html list

Could be there is an easier solution to do this

but this was my one and only idea

Bernd

Subject: RE: Replace Text in a RTF-Field

Depending on the nature of your news list the embedded view suggested by Stan could be a good solution. Or a piece of computed text that the user copies from some template – depending on context there may be different formulas, or again simply other fields on form may determine what kind of news will get picked up.

Still in most general case you are able to do placeholder substitution if you use as a placeholder a passthru HTML with DIV or SPAN instead of simple text placeholder (agreed, its not nice for the editor). In that case you could use JavaScript to enter the information upon loading.

For example:

Start of RT.

Some other text in RT.

Where value assigned in JavaScript is computed text.

Of course you may need modify the script/HTML to account for different browsers and some ancient browsers won’t do this at all.

On the other hand with most latest browsers you should be able to get all HTML, replace the placeholder and put back “innerHTML” of some tag around all your RT item. In this case it’s less troublesome for the user as she can use any $$$PLACEHOLDER$$$ without need to make it passthru.

Subject: RE: Replace Text in a RTF-Field

Thaks Normunds

Subject: RE: Replace Text in a RTF-Field

Why not use an embedded view?