indigoxela's picture

Hey people,
what do you use to embed video or audio tags (from uploaded files) in node bodies via Ckeditor?

To clarify, this is not about external providers (Youtube videos), it's about files users upload to the server.

I'd like to give them a possibility to show these files rendered as video and audio tag in the middle of content, not attached as a field. Is there an easy way to achieve this?

 

Comments

I think you're looking for the Insert module: https://backdropcms.org/project/insert

You can use it to insert HTML for a file field into another (textarea) field. I think by default it just inserts a link, but you should be able to play around with the template files (https://github.com/backdrop-contrib/insert/tree/1.x-1.x/templates) and change the inserted HTML to use the desired video/audio tags.

indigoxela's picture

I think you're looking for the Insert module...

That's an option, sure. On the other hand... I'd like something that plays nicely with file entities (records usage, picks up file updates, reusable files across the site...).

Maybe I'm thinking too complicated. ;-)

The first thought that comes to mind is a token. But I can't remember when a token is converted into its value (save or view). I think its view, in which case that'd be reusable (when a file is updated the body field would be too). That would actually be quite powerful: Token Insert. There's probably already a (Drupal?) module for that...

indigoxela's picture

After thinking about it for a while, I created a contrib module that does what I want.

I hope it's useful for others, too. ;-)