Skip to content
Advertisement

Drupal 7 – How to edit a value stored in variable table

I have inherited a multi-site in Drupal 7. There is a page where the client needs to edit the title element but this page is not a content type, a block or a taxonomy item!? I have queried the db and found only one instance of the value which needs to be changed. It is stored in the Variable table. If I change the value here the value changes as expected on the site. Can anyone shed any light on where the administration page is likely to be for this value based on the location of the value? I guess this could be defined anywhere really but was hoping someone may have come across this before.

Advertisement

Answer

The values of variables in Drupal can be set in a couple of ways:

  1. From code – Using variable_set() function.
    Look in the code if anywhere this function is called to set the value of the variable. If this is the case, you can implement your own module with some configuration form to override the value of the variable.
  2. From a form defined using the Form API – Using system_settings_form() function.
    I’ll suggest you to look for the name of the variable who’s value is used to set the page title, and then search in the code if there is a form element by that name, which is returned using system_settings_form. Then find out where this form is rendered – might be at some menu. After which you can change the value of this variable from the form itself.
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement