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 in this chapter. It is assumed that it has been completed successfully.
How to do it...
There are two changes that we will need to make to the existing implementation from the previous recipe. First, we will need to add our theme-specific setting. With...