Jump to content

HTML description


candidbeachweb

Recommended Posts

Hi,

I tried to find a way on how to add HTML description under the video player.

I am using hotlinking for video files and when i import videos with Text block i want to add a HTML description ( with link inside) that should appear under the video player.

I tried to find a way , read the documentation but could not find a fix for this issue i have.

As you can see in the image attached, the html code from description is not recognized.

Can you please advise

Thank you

temp.thumb.png.a27aae4ea0c0ed6434beb6259761d4ca.png

Link to comment
Share on other sites

For security reasons all HTML tags are escaped by default, so that users cannot inject harmful code when uploading videos.

If your project doesn't allow users to upload videos, you can make video description field support HTML tags by editing Website UI -> Pages -> View Video page -> video_view block template.

Find this:

<em>{{$data.description|replace:"\n":"<br>"}}</em>

Or in older theme version it may look like this:

<em>{{$data.description}}</em>

 

Change to this:

<em>{{$data.description|replace:"\n":"<br>"|smarty:nodefaults}}</em>

 

Link to comment
Share on other sites

It is possible to allow HTML for users as well, but there are 2 notes on that:

1) You should be using HTML Purifier library to filter harmful HTML code. This is supported in KVS, but we don't bundle the library. You should download it yourself and put its files into /admin/include/htmlpurifier directory (without version). Then in template you can use this:

{{$data.description|replace:"\n":"<br>"|html_purifier:false|smarty:nodefaults}}

It is configured with default settings that should allow removing all harmful code.

2) If you want to enable WYSIWYG editor for users, this is not supported in any KVS theme, so you have to attach them yourself. This should be pretty straightforward by reading theie documentation and it doesn't matter whether the site is KVS, or any other site.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
On 1/13/2021 at 7:36 PM, Serghei said:

Hi. Where is the best place for this code {{$data.description|html_purifier:false|smarty:nodefaults}} for video view page ? I've added this code into video view page code but didnt worked...

thanks

Did you download HTML purifier library into /admin/include/htmlpurifier?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...