0

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.

cd-media
  • 93
  • 1
  • 8
  • What is output of `href="{f:uri.image(image:'{newsImage}',width:'1000')}"`? If it is a valid link and is supported by Fancybox, then it should work fine (it does not look like your links points to YouTube) – Janis Apr 24 '23 at 14:30
  • @Janis Output is an image from the video. When I modify the link with browser tools and paste a real YT link, it works. So I think, I must modify the template part. – cd-media Apr 24 '23 at 14:36
  • regarding handling of different media you can have a look in the FLUID-templates of FSC for media. there is a partial which differs for different kind of media. You might use it in news if you provide the matching data. – Bernd Wilke πφ Apr 25 '23 at 05:18

0 Answers0