Reemski wrote:
I'm using text from a database in a text field. This text from the database contains html lay-out tags like <p> , <li> and <b>.
Is there a way to let Opus process the text as html text.
The easiest way to achieve this would be to retrieve the text from the database and write it directly to a .htm file using OpenFile() and Write() functions. You can now close this file using the CloseFile() function and display a Browser object which points to the .htm file to show the rendered web page.
I have attached a small example publication and database which demonstrate this.
Reemski wrote:
Another question: Is there a way to give different lines in a dynamic textfield different colours?
This effect is commonly known as a 'zebra table' and is popular in many applications (most notably iTunes).
I'm sure there is a dynamic way of achieving this via script, but I have attached a sample publication which uses a more clunky method. I have basically added a series of horizontal frames of alternating colours behind each visible row of a text box. I have then added my own up and down scroll buttons which determine which line is at the top of the text box. If the text is scrollable, a series of SetBackground() functions change the currently-blue frames to pink and vice versa. This swapping is prevented if you try to scroll past the top or bottom lines of the text box, so it should not matter if the text box was dynamically populated - the zebra table should behave correctly.
I hope this helps. Please do not hesitate to contact me if you have any further queries.
Kind regards,