5

Disclaimer: I'm new to Craft, making the jump from WordPress and looking for implementation advice to a specific requirement.

In addition to images, I would like to be able to manage oEmbed video references (mostly Vimeo URLs, and any associated metadata) from one central location: Assets. This way, when specifying the media assets for an entry, I can manage images and video together in one field, and can use drag & drop to order my content.

My intention is to extend the Assets UI with an additional button (after "Upload Files", called "Add oEmbed") that will generate a static file which acts as a pointer to the embed-able video.

Is this a sensible approach? If not, how would you suggest I go about it?

3

It's currently not possible to change a system CP section through a plugin. Also Assets are meant to be used for files, not for 'links-to-files'.

The simplest solution to your problem would be to use Dukt's Video plugin, you just wouldn't be able to manage assets and videos together in one single field.
You could write a new fieldtype-plugin though, which combines both element-types.

Another option would be the Link It plugin, but that would only allow you to add a link to the video.

4

Craft gives you the ability to combine different type of content in one single field, the matrix field. Configure one matrix block type for your images and one for your video links.

This setup still allows you to re-order your content (the matrix blocks) using drag & drop. You can further extend your entries with other types of content (maps, quotes, etc.) and have better accessibility to any fields assigned to your images and videos (not hidden behind double click).

3

Craft CMS plugin that does exactly this: https://github.com/benjamminf/craft-embedded-assets

  • Worth mentioning that this plugin was released Feb 18, 2016, nearly 2 years after the question was originally asked. – Lindsey D Sep 29 '16 at 23:32
  • @LindseyD yep… I added it for future viewers :) – Leevi Graham Sep 30 '16 at 0:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.