I have created a custom field type which integrates with a web service. I need to create a simple interface which allows the User ID and API key to be configured globally.

Will I need to create a module for this?

A simple example would be greatly appreciated!!

1 Answer 1


You can create a configuration page for your fieldtype by including a display_global_settings() and a save_global_settings() which display and save the settings respectively.

When your fieldtype class is instantiated your current settings are passed to a public settings property. You access your current settings within the display_global_settings() method with $this->settings['setting_name']. To display the settings page, return a string containing the HTML. You do not need to include a form tag or submit button in the returned HTML, these will be added for you.

To save the settings, you will create a save_global_settings() method. This method should retrieve the values using the $this->EE->input->post() method. You can manipulate the settings however you need, or simply place them all into a single array. The value you return from this method will be saved to the database and set to $this->settings next time the class is instantiated.

You can set the default settings value by returning it from the install() method.

You can find some examples under the global setting section of the fieldtype developer docs.

  • Fantastic, this worked perfectly :)
    – Lea Hayes
    Apr 3, 2013 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.