Skip to content

Commit

Permalink
Added custom collection and muted document parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed May 18, 2018
1 parent 7b9fb62 commit 39af758
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions developer/nodes-system/node_type_fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This following fields stores simple data in your custom node-source database tab
- YAML code
- Many to many join
- Many to one join
- Custom collection

.. note ::
*Single geographic coordinates* field stores its data in JSON format. Make sure you
Expand Down Expand Up @@ -116,3 +117,23 @@ You must fill the *default values* field for these two types.
orderBy:
- field: slug
direction: ASC
Custom collection
^^^^^^^^^^^^^^^^^

Last but not least, you can create a custom collection field to store read-only data using
a dedicated *Symfony* ``AbstractType``.

You must fill the *default values* field for this type:

.. code-block:: yaml
# AbstractType class name
entry_type: "Themes\MyTheme\Form\FooBarType"
You must understand that *custom collection* data will be stored as JSON array in
your database. So you won’t be able to query your node-source using this data.

In your ``FooBarType``, you’ll be able to use *Symfony* standard fields types and
**Roadiz** non-virtual fields too such as ``MarkdownType``, ``JsonType``, ``YamlType``.

3 changes: 2 additions & 1 deletion developer/themes/display_documents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Audio / Video options
* **autoplay** (boolean)
* **controls** (boolean)
* **loop** (boolean)
* **muted** (boolean)
* **custom_poster** (string): URL to a image to be used as video poster

You can use **multiple source files** for one video document or audio document.
Expand Down Expand Up @@ -126,7 +127,7 @@ You can find more details in `our API documentation <http://api.roadiz.io/RZ/Roa
* If document is an **image**: ``getDocumentByArray`` method will generate an ``<img />`` tag with a ``src`` and ``alt`` attributes.
* If it’s a **video**, it will generate a ``<video />`` tag with as many sources as available in your document database. Roadiz will look for same filename with each HTML5 video extensions (filename.mp4, filename.ogv, filename.webm).
* Then if document is an external media **and** if you set the ``embed`` flag to ``true``, it will generate an iframe according to its platform implementation (*Youtube*, *Vimeo*, *Soundcloud*).
* Get the external document URI (the one used for creating iframe for example) with ``(document|embedFinder).source`` twig command.
* Get the external document URI (the one used for creating iframe for example) with ``(document|embedFinder).source`` twig command.

Manage global documents
-----------------------
Expand Down

0 comments on commit 39af758

Please sign in to comment.