mstdmstd's avatar

How to show youtube urls and images on vuejs frontend pages?

Hello,

in my laravel 8 app with jquery 3.4/bootstrap 4.6 for adminarea part of the app I use summernote for entering text fields and I need on frontend part (vue 2.6/bootstrap 4.6/Axios) to show these text fields into HTML component on the frontend vue page, which includes youtube urls and images uploaded under local server Storage. Just something like :

  1. Admin in summernote editor put in some places youtube urls / images and save
  2. These youtube urls / images are shown on frontend vue pages

I search something like : under summernote fill some tags like :

<youtube>youtube_url</youtube> 

and youtube block will be shown on frontend vue page in place of this tag.

<image>image_url</image> 

and styled image will be shown on frontend vue page in place of this tag. When in 1 place of frontend vue page we need to show 1 youtube url or image - that is simple task. But if there could be several youtube urls or images in ANY place of the text - the task is rather complicated.

Could you please advice some extentions/decisions for this ? Thanks!

0 likes
4 replies
mstdmstd's avatar

Surely no, I remember 8-10 years ago I modified some WYSIWYG editor for similar purposes. Now I do not remember this editor name. and as that is vuejs page(not static html) I think it would be more complicated. I search some ready decision. I think I am not first having such task.

piljac1's avatar

I might be missing something, but can't you do a global sanitization and replace these custom tags on the backend and then output them as raw HTML in your Vue component(s)?

1 like
mstdmstd's avatar

Yes, I am thinking about similar. But maybe therr some good decisions....

Please or to participate in this conversation.