This tutorial aims at covering the conception and development of a custom eZ Publish 5 FieldType.
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’s HTML & author URL in a custom database table
display the tweet when displaying the field from a template
About Field Types
They are the most granular building block for content managed by eZ Publish. Quite a few are shipped by default (https://confluence.ez.no/display/EZP/FieldTypes).
They 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 FieldTypes are a very powerful type of extension, since they allow you to hook deep into the content model.
You can find the in-depth depth documentation about FieldTypes and their best practices.
...
About this tutorial
This tutorial aims at covering the conception and development of a custom eZ Publish 5 FieldType.
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’s HTML & author URL in a custom database table
display the tweet when displaying the field from a template
Steps
The bundle
FieldTypes, like any other eZ Publish 5 extensions, must be provided as Symfony 2 bundles. This chapter will cover the creation and organization of this bundle
...