It would be nice if a display option Colorbox is available to show the video in a colorbox.
I installed colorbox 8.x-1.x-dev but the display option is not available in the video field.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ecvandenberg created an issue. See original summary.

Sam152’s picture

Assigned: Unassigned » Sam152

I have started working on this feature for 8.x. Patch should be incoming soon.

Sam152’s picture

jibran’s picture

LGTM

+++ b/src/Plugin/Field/FieldFormatter/Colorbox.php
@@ -0,0 +1,157 @@
+    return \Drupal::moduleHandler()->moduleExists('colorbox');

This can be injected. Don't you want to check install instead of exist.

Sam152’s picture

> ModuleHandler::moduleExists
> Determines whether a given module is enabled.

Also, the method is static, so can't inject a dependency.

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Yes, you are right it is still confusing sometimes D8 doesn't have a disable state :). Correct on static method too. So looks good RTBC.

jibran’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/src/Plugin/Field/FieldFormatter/Colorbox.php
@@ -0,0 +1,157 @@
+          'data-video-embed-field-modal' => (string) $this->renderer->renderRoot($videos[$delta]),

Maybe move this to preRender.

Sam152’s picture

Not sure what that would look like. Is there any example of this anywhere?

Sam152’s picture

Going to commit this and have it battle tested in an RC2. I will follow-up with the early rendering with some more manual testing and look into the preRender use case.

  • Sam152 committed ae23117 on 8.x-1.x
    Issue #2621268 by Sam152, jibran, ecvandenberg: Colorbox display option
    
Sam152’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.