O'Reilly logo

Drupal 8 Development Beginner's Guide - Second Edition by Kurt Madel, Malabya Tewari, Rakesh James, Krishna Kanth, Edward Crompton, Samuel Keen, Tassos Koutlas, Neeraj Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – enhancing the Colorbox module with image title and alt captions

So, where do we begin implementing this proposed approach and complete the associated feature request? We will start by debugging the available processed $variable in the template_preprocess_colorbox_formatter() function so that we can modify or add required properties to the image field:

  1. In PhpStorm, open the colorbox.inc file in your contribute modules at the /modules folder.
  2. Before we start modifying or adding code, let's understand the code in the template_preprocess_colorbox_formatter() function in the colorbox.inc file. First, we need to know where caption settings are saved. There is the $settings variable that has been declared; add the following code next ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required