Want to create module about variables editable by users - anything similiar already?

Events happening in the community are now at Drupal community events on www.drupal.org.
gumol's picture

Hi.

I want to create module which allows users to modify variables chosen by admin.

Idea: I have created site for my client and want him to change some information on website, where I cannot allow him to access to code etc.

Example 1: I prepared block which use PHP Code and want client to have access to one text string change, but not for all PHP code.
Example 2: I have jquery code which sets default form value and want client to have access only to the default value change, not all of jquery code.

Solution:
1. Admin defines which variables user can edit and human readable label for them
2. User go to the page, where all allowed variables are displayed and can modify them.
3. Only users with specific permission can access the page, hence can modify vars.

I am aware of module drupal_variables existence but it:
1. Do not allow to define which vars can user edit
2. Do not allow to set human readable label, so it is not elegant way to edit vars by client.
3. Do not displays all variables in only one page.

Does any other module do something similar? Any ideas about features for this kind of module?

I attach the very start of this module development.

AttachmentSize
variables_for_users.gz2.43 KB

Comments

Admin page

dsm's picture

Typically this is accomplished via an admin settings screen. Automating an admin screen sounds kind of interesting though

global fields

no2e's picture

This could be used for something like a footer contact info, too, right?

For example, you have the telephone number in your footer (on all pages):
<p>Tel: <span>555-0100</span></p>
Now the admin could replace the number with a variable:
<p>Tel: <span>[var:telephone-number]</span></p>
And the content editor could change the telephone number in the interface, without intefering with the markup.

It would be like "fields for the whole site" (instead "fields for entities") – which, in my opinion, would be really useful. I often needed functionality like this, and ended up using a "dummy" content type with a dummy node, and using Views to create blocks out of those node fields.

Exactly.

gumol's picture

Exactly.

Tokens

dsm's picture

again, I don't see why we couldn't use tokens for this use case

Interesting

fmizzell's picture

I have not tried this module but it looks interesting, and it seems to have some of the features you are talking about.

http://drupal.org/project/variable

The devel module provides

greggles's picture

The devel module provides this feature at devel/variable

It's a bit hidden there, I'll admit.

Data Dictionary

dwieeb's picture

I was working on something exactly like what you're proposing. You can see my module here: http://drupal.org/sandbox/dwieeb/1294972

I'm not developing it anymore, because, as people have said you can use Tokens along with Token Insert, Token Filter and Custom Tokens to achieve the same thing.

Today I test this module

eloivaque's picture

Today I test this module https://www.drupal.org/project/eck

And I create one global entity and bundle user_variables

It's an other solution.

Contributed Module Ideas

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: