O'Reilly logo

Drupal 7 Development by Example Beginner's Guide by Kurt Madel

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 File module with field-based captions

So, where do we begin to implement this proposed approach and complete the associated feature request? We will start by modifying the field settings form for all file type associated text fields. This is where you will be able to configure that a field's value should be used as the value for the Colorbox caption for a given file type. We will use a hook that we used earlier in this chapter, hook_form_FORM_ID_alter, to modify the form used to configure text fields for all file types. In order to do that, we need to figure out what FORM_ID we need to use as part of the function name for that hook, and we will again turn to the Devel module to help us with this.

  1. First, ...

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