Jump to content

Allow images in recent posts feed?

Featured Replies

Posted

Hello,

Our forum allows users to post videos which are embedded directly into posts using HTML5 <video> tags.  I was wondering if it is possible to insert the video thumbnail image into the recent posts feed in the sidebar?
 

Does anyone have any idea of how this can be done?

Thanks a lot.

  • Community Expert

A HTML5 video doesn’t have a video thumbnail. 

  • Author

Thanks for coming back to me so quickly.

Sorry - I meant the poster image.

At the moment the text between the <video> </video>  tags is displayed as if the browser doesn't support video tags - which is expected.

I could include an <img> in there but how can I enable images to be displayed in the posts feed?

e.g.

<video class="myvideovid" controls="" height="480" poster="/PATH/TO/IMAGE/theimage.jpg" width="640">
<source src="/PATH/TO/VIDEO/thevideo.mp4" type="video/mp4">
<img src="/PATH/TO/IMAGE/theimage.jpg" class="videoposter">
</video>

 

I don't mind editing  code - I'm just not sure where the post html is cleaned for displaying in the feed.  Maybe I could allow images through by class? Or just images that are contained between video tags?

Edited by Simon Harvey

  • Community Expert

There is no option to “enable” it. You would have to edit the postFeed template of your theme. The stripped version without images/videos is created through this:
{$comment->truncated( true )|raw}

  • Author

Ah great, that's exactly what I was looking for - I'll create my own truncated version that allows for the video poster images to be displayed.

Thanks for your help. 

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.