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.
Version 8.x-1.6 includes example colorbox styles in the following code in ColorboxSettingsForm.php
:
$form['colorbox_custom_settings']['colorbox_style'] = [
'#type' => 'select',
'#title' => $this->t('Style'),
'#options' => $colorbox_styles,
'#default_value' => $config->get('custom.style'),
'#description' => $this->t('Select the style to use for the Colorbox. The example styles are the ones that come with the Colorbox plugin. Select "None" if you have added Colorbox styles to your theme. <br> <strong>Examples</strong>: <ul><li><a href="/modules/contrib/colorbox/images/admin/example_default.png" target="blank">Default</a></li><li><a href="/modules/contrib/colorbox/images/admin/example_plain.png" target="blank">Plain</a></li><li><a href="/modules/contrib/colorbox/images/admin/example_stockholm_syndrome.png" target="blank">Stockholm Syndrome</a></li><li><a href="/modules/contrib/colorbox/images/admin/colorbox_example_1.png" target="blank">Example 1</a></li><li><a href="/modules/contrib/colorbox/images/admin/colorbox_example_2.png" target="blank">Example 2</a></li><li><a href="/modules/contrib/colorbox/images/admin/colorbox_example_3.png" target="blank">Example 3</a></li><li><a href="/modules/contrib/colorbox/images/admin/colorbox_example_4.png" target="blank">Example 4</a></li><li><a href="/modules/contrib/colorbox/images/admin/example_none.png" target="blank">None</a></li></ul>'),
];
Drupal modules should never assume the location of module directories. For example, many sites use a multisite setup or place modules in a subdirectory such as /modules/
. In those types of environments, the #description
will always return a "404 Not Found".
Drupal 7 issue: https://www.drupal.org/project/colorbox/issues/3127345
Comment | File | Size | Author |
---|---|---|---|
#4 | CQEkaoZ - Imgur.png | 238.8 KB | ilgnerfagundes |
#4 | DGAE38E - Imgur.png | 24.6 KB | ilgnerfagundes |
#4 | gLJau2x - Imgur.png | 100.35 KB | ilgnerfagundes |
Issue fork colorbox-3183921
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
shashikant_chauhan CreditAttribution: shashikant_chauhan as a volunteer commentedComment #4
ilgnerfagundes CreditAttribution: ilgnerfagundes at CI&T commentedI checked out the branch and the images are opening correctly
Comment #5
renatogTested and really works
Comment #7
renatogMerged into dev branch
Comment #8
renatogThank you, everyone, great job