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.
The function _colorbox_active()
only checks for the configured paths to include/exclude colorbox from the page. Unfortunately this is not flexible enough (at least for our needs ;)).
Guess you wan't include colorbox on admin pages (as done by default using the path "admin*" in the configuration "Show colorbox on specific pages" but need to add it to a specific administration page. Currently there is no way to include one specific path but exclude all others of this type.
Proposal: add an alter-hook to _colorbox_active()
so other modules can change the state of colorbox.
Comment | File | Size | Author |
---|---|---|---|
#3 | alter_activation-2374425-3.patch | 1.06 KB | stBorchert |
#1 | alter_activation-2374425-1.patch | 1.08 KB | stBorchert |
Comments
Comment #1
stBorchertHere is a patch which simply adds
drupal_alter('colorbox_active')
.Comment #2
frjo CreditAttribution: frjo commentedLooks like a solid patch that would improve Colorbox without any bad side effects.
What do you think about changing the hook_alter parameter name from "$page_match" to "$activate"? Seems lika a more logical wording for the hook?
Comment #3
stBorchertChanged the name of the parameter in colorbox.api.php to
$active
(which sounds more like a state).Patch built on top of current HEAD.
Comment #5
frjo CreditAttribution: frjo commentedCommitted to 7.x-2.x. Thanks for the contribution!