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.

CommentFileSizeAuthor
#2 youtube-modal-hooks-2478345-2.patch12.51 KBguschilds
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

guschilds’s picture

mstrelan, That's a great idea. Any chance you could supply a patch for this? Thanks!

guschilds’s picture

Status: Active » Needs review
FileSize
12.51 KB

I've attached a patch that does just that. It uses 3 hooks to allow modules (like youtube_colorbox) to:

  • add a "link type" in the YouTube Thumbnail formatter settings (hook_youtube_thumbnail_link_types_alter())
  • add formatter settings for that specific link type (hook_youtube_thumbnail_field_formatter_settings_alter())
  • build the resulting link data when the thumbnail is rendered (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.

  • guschilds committed 072ad7b on 7.x-1.x
    Issue #2478345 by mstrelan, guschilds: Support other modal modules by...
guschilds’s picture

Status: Needs review » Fixed

The 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.

Status: Fixed » Closed (fixed)

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