Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8933863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:38:41+00:00 2026-06-15T09:38:41+00:00

I have created a custom module that sets a system variable using variable_set(). I

  • 0

I have created a custom module that sets a system variable using variable_set(). I would like someone with the proper permissions to be able to edit this variable via the admin. I’m sure there are contributed modules that allow you to edit system variables, but I was looking for a way to include this functionality right in my custom module. I would like to maybe hook into the “Site Information” admin form or maybe the “File System” admin form and include a text field where they could edit this system variable and it would save. What’s the best way to go about this?

THANKS

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:38:42+00:00Added an answer on June 15, 2026 at 9:38 am

    The Site Information form uses system_settings_form() which means you just need to add your variable as an element to the form (using hook_form_alter() or, as in the following, hook_form_FORM_ID_alter()) and the system will handle saving it.

    function MYMODULE_form_system_site_information_settings_alter(&$form, &$form_state) {
      $form['my_variable_name'] = array(
        '#type' => 'textfield', // or whatever element makes sense
        '#title' => t('Title'),
        '#default_value' => variable_get('my_variable_name', '')
      );
    }
    

    Same thing goes for the system_file_system_settings() form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom module that creates a custom Database table. I have
I have created a custom module that includes a hook_submit function. Is it possible
I have created a custom module and am using hook_block to programmatically create some
I have created a custom DNN module with 2 .ascx files that I have
I have created custom attributes for a category in my module's install script like
I created a custom module for Orchard following this wonderful guide . I have
I've created a custom module citation for academic references. Citations have, among other things,
I have a module in which I created a custom page with controller and
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have created a custom method that will return unique items, together with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.