Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Instead of hard coded calls to youtube_colorbox in the youtube module it would be better to provide hooks that other modules (including youtube_colorbox) can implement. That would allow for youtube_shadowbox, youtube_lightbox2, etc.
Comment | File | Size | Author |
---|---|---|---|
#2 | youtube-modal-hooks-2478345-2.patch | 12.51 KB | guschilds |
Comments
Comment #1
guschilds CreditAttribution: guschilds commentedmstrelan, That's a great idea. Any chance you could supply a patch for this? Thanks!
Comment #2
guschilds CreditAttribution: guschilds at Chromatic commentedI've attached a patch that does just that. It uses 3 hooks to allow modules (like youtube_colorbox) to:
hook_youtube_thumbnail_link_types_alter()
)hook_youtube_thumbnail_field_formatter_settings_alter()
)hook_youtube_thumbnail_link_uri_alter()
)I've added documentation for these hooks in an api.php file and altered the youtube_colorbox module to use these hooks. That module continues to function just the same.
Would appreciate any reviews of this work! Should help anyone hoping to link thumbnails to anything else, including other modal window libraries.
Comment #4
guschilds CreditAttribution: guschilds at Chromatic commentedThe patch from #2 was committed to the 7.x-1.x branch and will be a part of the future 7.x-1.7 release. Thanks again for the suggestion.