Jump to content

Allow images in recent posts feed?


Simon Harvey

Recommended Posts

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.

Posted

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?

Posted

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}

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...