Message-ID: <1531146324.2798.1485850836811.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2797_1129768908.1485850836811" ------=_Part_2797_1129768908.1485850836811 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This tutorial aims at covering the creation and development of= a custom eZ Platform=20 Field Type.
We will do this by implementing a Tweet Field Type. It will:
Accept as input the URL of a tweet (https://twitter.com/<username= >/status/<id>)
Fetch the tweet using the Twitter oEmbed API (https://dev.twitter.com/docs/embedded-tweets)
Store the tweet=E2=80=99s embed contents and URL
Display the tweet's embedded version when displaying the field from = a template
Field Types are the most granular building blocks for content managed by= eZ Platform. The system comes with about 30 native types that cover most common needs (Text = line, Rich text, Email, Author list, Content relation, Map location, Float,= etc.)
Field Types are responsible for:
Storing data, either using the native storage engine mechanisms, or = specific means
Validating input data
Making the data searchable (if applicable)
Displaying an instance of the type
Custom Field Types are a very powerful type of extension, since they all= ow you to hook deep into the content model.
You can find the in-depth documentation about Field Types and their best prac= tices here. It describes how each component of a Field Type interacts w= ith the various layers of the system, and how to implement those.
The code created throughout this tutorial is available on GitHub: <= a href=3D"https://github.com/ezsystems/TweetFieldTypeBundle" class=3D"exter= nal-link" rel=3D"nofollow">https://github.com/ezsystems/TweetFieldTypeBundl= e.
Field Types, like any other eZ Platform plugin, must be provided as= Symfony2 bundles. This chapter covers the creation and organization of thi= s bundle.
Read more about creating and structuring the bundle.
This part covers the implementation of the eZ Platform API elements requ= ired to implement a custom Field Type.
Read more about imp= lementing the Tweet\Value class and the Tweet\Type class.
Storing data from any Field Type into the Legacy Storage Engine requires= that your custom data is mapped to the data model.
Read more about implementing the Legacy Storage Engine Converter.<= /p>
Displaying a Field Type's data is done through a Twi= g template.
Read more about impl= ementing the Field Type template.
Viewing and editing values of the Field Type in PlatformUI requires that= you extend PlatformUI, using mostly Javascript.
You should ideally read the general extensibility documentation for PlatformUI. The p= art about templating covers view templates. Edit templates are not docu= mented at the time of writing, but Netgen has published a t= utorial that covers the topic: http://www.netgenlabs.com/Blog/Addin= g-support-for-a-new-field-type-to-eZ-Publish-Platform-UI.