O'Reilly logo

Drupal 6 Theming Cookbook by Karthik 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

Adding a custom theme setting

While it is quite straightforward to just edit a template file and add our changes, there are situations where this might not be feasible. When a theme-specific variable needs to be routinely modified or in cases where editing template files is not an option, the ideal solution is to make it a configurable setting. This can be done either by adding a form element by way of a module, or as this recipe will outline, by way of a configuration setting on the theme's administration page.

As an example, this recipe will make the disclaimer variable used in an earlier recipe in this chapter, a configurable option.

Getting ready

This recipe is a continuation of the Adding a variable to all node templates recipe from earlier ...

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