Tip storing and managing text
Managing texts in Version 7 is simple, and works exactly as the images shown. Two points should be considered:
* The storage of the texts in the database.
* The display of the texts on a page.
Storage in the database
There are two methods used to handle the database storage:
- The simplest method is to let the supervisor manage the data. This assumes that the used data type is a Rich media type with the Supervisor management check box selected. In this case, the text must be stored in a dedicated table. The table, the column that stores the image, and the key component values that perform the join to get the text are entered in the class dictionary.
- If the data type has the Supervisor management check box cleared, the developer must manage the assignment of the text field values. This is done by using the media management events and requires writing the code.
Manage the text in the user interface
Two choices for the UI behavior
There are two methods for managing a text in the user interface:
- The first method is to display the text at a given place on the page. To do this, you must use data types that have a content type equal to text/format (where format can be plain, HTML, RTF, and so forth). The standard data types 'ACHTML', 'ACRTF', and 'ACPLAIN' are dedicated to this and the storage management is done by the supervisor.
- The second method is to display a link that triggers the display of the picture upon clicking. To do this, you must use a data type associated with the content type application/x-document. This is the case for the data type 'AC0' where a link appears. However, if you want to have an icon that represents the type of file instead of this link, you need to dynamically assign the content type.