CreateYoutubeUriViewHelper
The ViewHelper e2: searches the given link for the
YouTube ID and returns the embedded YouTube link of this ID.
Link: https://
YouTube ID: B5g
Embedded link: //
Changed in version 12.0.0
The argument link is optional. If it is not set, the tag content
is used, so the ViewHelper can be used in inline syntax.
Arguments of the CreateYoutubeUriViewHelper
link- The YouTube link or the YouTube ID. If not set, the tag content is used.
Example for the CreateYoutubeUriViewHelper
EXT:my_sitepackage/Resources/Private/Templates/Video/Show.html (excerpt)
{namespace e2=JWeiland\Events2\ViewHelpers}
<iframe width="560"
height="315"
src="{e2:createYoutubeUri(link: event.videoLink.link)}"
allowfullscreen></iframe>
<!-- Inline syntax -->
<iframe width="560"
height="315"
src="{event.videoLink.link -> e2:createYoutubeUri()}"
allowfullscreen></iframe>
Copied!