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.
Hi, there would be great to upgrade the usage of "Deactivate Colorbox on specific pages". I'm using colorbox in only one content type, and it's just annoying to exclude all pages when there should be something to allow colorbox only on specific pages. (like blocks should be perfect)
thanks for all.
Comment | File | Size | Author |
---|---|---|---|
#6 | colorbox_visibility_1563732.patch | 1.95 KB | frjo |
#5 | colorbox-add-include-only-1563732.patch | 1.54 KB | inventlogic |
#4 | colorbox-add-include-only-1.patch | 1.54 KB | inventlogic |
#2 | Untitled-3.jpg | 52.05 KB | FAAREIA |
Comments
Comment #1
lsolesen CreditAttribution: lsolesen commentedSo exactly what are you suggesting. Could you create a screen mockup or even a patch to include this?
Comment #2
FAAREIA CreditAttribution: FAAREIA commentedI don't know how to code, but here is an screenshot. The main idea is to easily load colorbox in pages that needs it. In the current "Deactivate Colorbox on specific pages" you need to list all pages except the ones that needs it. (usually you need to update this list since you create new taxonomies, or even custom paths)
Thanks for your time.
Greetings
Comment #3
inventlogic CreditAttribution: inventlogic commentedAgreed this should be a feature. Activate on following pages or Deactivate on following pages.
I have added the following to my admin theme template.php. It adds a check-box at the bottom of the admin/config/media/colorbox settings form under ADVANCED SETTINGS. If you tick the check-box the pages listed will have the colorbox javascript included. Everything else is automatically excluded.
I then changed the following code in colorbox.module
To the following which includes a test for the include only checkbox set to true.
Seems to work by only including colorbox on the listed pages. Anyone else adding this to their template.php please test before using.
Can this be added to the next version of colorbox please?
Comment #4
inventlogic CreditAttribution: inventlogic commentedAttached is a patch against the Master branch to include the check-box.
Comment #5
inventlogic CreditAttribution: inventlogic commentedSame patch file renamed with the issue number
Comment #6
frjo CreditAttribution: frjo commentedPlease test my revised patch for this functionality. I have made it lock just like it does for blocks in Drupal core.
Comment #7
inventlogic CreditAttribution: inventlogic commentedThanks. Applied patch against 7.x-1.x-dev and works.
Comment #8
frjo CreditAttribution: frjo commentedThanks for testing! Committed to 7-dev.
Comment #9
FAAREIA CreditAttribution: FAAREIA commentedExcellent work. Many thanks for this patch, it works perfectly.
Comment #11
Jason_K CreditAttribution: Jason_K commentedI'm still using Druapl 6, and don't know enough about coding to rewrite this for Colorbox 6.x, but it would be so useful. Anyone know of an equivalent patch for 6.x? Thanks.