DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
Developer Corner¶
How does Fluidcontent YouTube work?¶
Using EXT:fluidcontent
and its dependency EXT:flux
a Flexible Content Element is created. In the Controller, a special Utility is used to extract the YouTube Video ID from the entered URL and made available to the template.
Templating¶
In the template there are three important sections defining the use of this extension:
- Configuration: the Flux configuration for rendering the FlexForm. This specifies the YouTube URL field to be available.
- Preview: this section will be used to render the preview in the Page module.
- Main: this section will be used to render the element in the front-end.
By default, the main section uses EXT:vhs
to add a tiny CSS file to the page to make the YouTube video embed responsive. The CSS is based on the SUIT CSS FlexEmbed component.
Testing¶
To run the Fluidcontent YouTube unit tests, first install EXT:phpunit
. Then, invoke the test runner from the command line:
/path/to/typo3/cli_dispatch.phpsh phpunit typo3conf/ext/fluidcontent_youtube/Tests/Unit/