verbb/hyper

Add a preview for OEmbed links

benfeather opened this issue · 6 comments

What are you trying to do?

It would be helpful to have a preview when using Hyper to link videos via OEmbed.

What's your proposed solution?

Could you add the option to output a video preview for the link?

This could be another native field that we could add to the input.

preview

Additional context

No response

I like the idea of this being another native field to include so it's not tied to the "Link" field. For example:

Screenshot 2023-12-06 at 8 20 12 pm

If I were to add the preview on the half-width link field to the left, it would look pretty unbalanced next to the "Link Text".

My immediate concern though, is how to format the preview so as not to take up oodles of the screen or in a too-small area. For example:

Screenshot 2023-12-06 at 8 50 31 pm

Is it possible to configure field width in the Craft CP columns layout? The user could limit the preview to one or two columns and use less space.

link-cols

Another option would be to add a toggle to collapse or expand the preview.

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

I've also had to do some iframe wrangling to ensure it's responsive. Some providers like YouTube provide it, while others (X/Twitter) don't, and they don't look so hot being full-width, as there's a lot of white space (see above). YouTube on the other hand responds to the width and looks nice.

I've updated the plugin, but I don't see a preview field:

fields-ver

fields

Should be under "UI Elements"?

Ah, my mistake! It's there, and it looks great. Thanks again.