Support for disabling certain of the embed link type
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
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.
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.
Added for the next release. To get this early, run composer require verbb/hyper:"dev-craft-4 as 1.1.17".
It's probably really obvious, but I can't seem to find where to update the field.
It's not a field setting, but a plugin setting. See embedAllowedDomains
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.