Editing XHTML Text

Some of the fields in a content item may contain formatted text. A typical textual content item has one such field (often called body) that holds the main content. When you put the cursor in a field that contains formatted text, the formatting bar displayed at the bottom of the Field Options tab (see Field Options) is enabled:

graphics/field-options.png

You can then use the buttons in this bar to format the text you enter. The tools available in the formatting bar may vary from publication to publication.

Internally, the formatted text is stored as XHTML. You can, if you wish, view the source XHTML and/or edit it. To do so:

  1. Right-click somewhere in the formatted field.

  2. Select Edit Source from the displayed menu. The source XHTML is then displayed. An OK and a Cancel button is also displayed at the bottom of the field.

  3. Examine/edit the displayed XHTML.

  4. To save your changes, click on OK, or click on Cancel to cancel any changes you may have made.

You can use this function to:

  • Insert or modify XHTML code in ways that the formatting bar does not allow.

  • Paste in blocks of XHTML code copied from other programs or web sites.

It is particularly useful for pasting in predefined video links copied from web sites such as YouTube, Flash animations and so on.

You should be careful using this function unless you are comfortable editing XHTML code. Error messages are displayed at the top of the field if the content is invalid, which provides some guidance. When you save your edits, any mistakes you make will be corrected to ensure that the field contains valid XHTML, but the corrections may give unexpected results.