hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Support for disabling certain of the embed link type

Open Antimated opened this issue 2 years ago • 6 comments

What are you trying to do?

Hi 👋

I'm trying some things out with hyper and one idea I had was creating a "Video embed" matrix block which well... displays embedded video's. The only thing I could't do was set a list of certain providers I want to be entered by the customer. In this case I would only want to whitelist "Youtube" and "Vimeo".

What's your proposed solution?

Whitelist (or blacklist) for enabling/disabling certain types of embeds.

Additional context

No response

Antimated avatar Feb 28 '23 13:02 Antimated

Yep, so at the moment, an embed link type just accepts anything, we can look at maybe adding settings for allow/deny providers, but we also don't have a definitive list of providers to select from. We also can't use the base domain because providers like YouTube use multiple ones.

engram-design avatar Mar 01 '23 00:03 engram-design

I would like to see this feature implemented as well. Is it possible to have a simple regex input in the field settings? This way, the user can configure it to match any site, and there would be no need for you to maintain an exhaustive list of providers.

benfeather avatar Dec 06 '23 20:12 benfeather

Added for the next release. To get this early, run composer require verbb/hyper:"dev-craft-4 as 1.1.17".

engram-design avatar Dec 07 '23 08:12 engram-design

It's probably really obvious, but I can't seem to find where to update the field.

benfeather avatar Dec 07 '23 09:12 benfeather

It's not a field setting, but a plugin setting. See embedAllowedDomains

engram-design avatar Dec 07 '23 10:12 engram-design

Could this setting be editable at the field level?

This would allow the user to create a field for each embed type, e.g. a video field would whitelist YouTube/Vimeo etc. Then, it would be easy to know what data is stored in the new linkValue JSON property, as it will be consistent for each provider.

Just an idea, though not essential.

benfeather avatar Dec 07 '23 20:12 benfeather