Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
     Glossary
   eZ Publish 4.x / legacy

 
eZ Publish (5.x)

eZ Publish 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for eZ Publish 4.x and Legacy topics see eZ Publish legacy

Skip to end of metadata
Go to start of metadata

This format is used by eZ P

 

This FieldType is not officially supported yet, it will be as of first stable eZ Platform release.

This FieldType validates and stores structured richtext, and exposes it in several formats.

NameInternal nameExpected input
RichText
ezrichtext
mixed

Input expectations

TypeDescriptionExample
string
XML document in one of the FieldType's input formats as a string.See the example below.
DOMDocument

XML document in one of the FieldType's input formats as a

DOMDocument object.

See the example below.
eZ\Publish\Core\FieldType\RichText\Value
An instance of the FieldType's  Value  object.See the example below.

Input formats

FieldType works with XML and also expects an XML value as input, wether as a string,  DOMDocument object or FieldType's  Value  object. When the value is given as a string or a DOMDocument  object, it will be checked for conformance to the one of the supported input formats, then dispatched to the appropriate converter, to be converted to the FieldType's internal format. No conversion will be performed if providing the value in FieldType's internal format, or when providing the value as FieldType's  Value  object. In the latter case it will be expected that Value  object holds the value in FieldType's internal format.

Currently supported input formats are described in the table below:

NameDescription
eZ Publish Docbook variantFieldType's internal format
XHTML5 editing formatTypically used with in-browser HTML editor
Legacy eZXML formatCompatibility with legacy eZXML format, used by XmlText FieldType  

Example of the FieldType's internal format

Example of the FieldType's XHTML5 edit format

This format is used by eZ Platform Online Editor and will change with its needs as we continue to evolve this part of the UI.


For more information about internal format and input formats, see FieldType's conversion test fixtures on GitHub.

For example, ezxml does not use explicit level attributes for <header> elements, instead <header> element levels are indicated through the level of nesting inside <section> elements.

Example of using XML document in internal format as a string

Value object API

eZ\Publish\Core\FieldType\RichText\Value  offers following properties:

PropertyTypeDescription
xml
DOMDocument
Internal format value as an instance of  DOMDocument.

REST API specifics

Creating or updating Content

When creating RichText content with the REST API, it is possible to provide data as a string, using the "xml" fieldValue key:

When the value given over REST API is transformed into a FieldType's  Value  object, it will be treated as a string. This means you can use any supported input format for input over REST API.

2 Comments

  1. Unknown User (eirikj)

    Now that we're approaching the release of eZ Platform, this page is perhaps due for an update?

  2. Ideally this should have been on github so you could have contributed to it, but yes in time it will (smile)