---
title: "CreateYoutubeUrlViewHelper"
manual: "Events2"
version: "11.1"
permalink: "https://docs.typo3.org/permalink/jweiland/events2:youtubeviewhelper@11.1"
source: "AdministratorManual/Templates/ViewHelpers/CreateYoutubeUrlViewHelper.rst"
rendered: "2026-11-05T08:42:15+00:00"
---

# CreateYoutubeUrlViewHelper {#youtubeviewhelper}

It searches the given link for Youtube ID and attaches the ID to the embedded Youtube Link.

## Examples {#examples}

Link: [https://www.youtube.com/watch?v=B5gDI2h0F20](https://www.youtube.com/watch?v=B5gDI2h0F20)
Youtube ID: B5gDI2h0F20
Embedded link: //www.youtube.com/embed/B5gDI2h0F20

### Basic example {#basic-example}

```html
<iframe width="560" height="315" src="{e2:createYoutubeUri(link: event.videoLink.link)}" frameborder="0" allowfullscreen></iframe>
```
