How to show YouTube video in tx_news with fancybox?

71 Views Asked by At

I'm using TYPO3 with the tx_news extension and fancybox for the lightbox function. Now I want to modify the template to show YouTube videos, which are added via URL in the news entry.

I do not really now how to handle it. Maybe anyone can give me an advice to solve that. Here is the code. It wirks for images, but not for YouTube videos.

<f:for each="{newsItem.falMedia}" as="newsImage" iteration="iterator">
  <f:if condition="{iterator.index} > 0 && <= 3">
    <a href="{newsImage}">
      <a href="{f:uri.image(image:'{newsImage}',width:'1000')}" data-fancybox="fancybox{newsItem.uid}">
    <f:image image="{newsImage}" class="img-fluid" width="800c" height="600c" alt="{newsImage.originalResource.alternative}" />
      </a>
    </a>
  </f:if>
</f:for>

EDIT: Output is an png image from the video.

0

There are 0 best solutions below