Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello.
I want to use variable as token. It will be very usefull in many cases, for example in metatags. I think that use separate token for each variable as in module token_var is not very good idea. And I prepared patch for use variable in token dynamically by name.
Example of use:
[variables:variable-name:site_slogan]
UPD
https://drupal.org/project/variable module provides this feature by default
This is more preferable way to use variables as tokens
Example: [variable:site_mail]
Comment | File | Size | Author |
---|---|---|---|
#1 | 2046461-use-variable-as-token.patch | 1.63 KB | eugene.ilyin |
Comments
Comment #1
eugene.ilyin CreditAttribution: eugene.ilyin commentedI will be glad if you will apply my patch and specify me as author of commit.
Comment #2
eugene.ilyin CreditAttribution: eugene.ilyin commentedComment #3
aes3xs CreditAttribution: aes3xs commentedComment #4
eugene.ilyin CreditAttribution: eugene.ilyin commentedWhat the problem?
Comment #5
eugene.ilyin CreditAttribution: eugene.ilyin commentedAny news?
Comment #6
Dave ReidI think this opens up a huge security risk. Just by granting a user access to the token filter means they can then get my site's cron key, private key, and other "confidential" information that may be stored in the variables table. I'm not willing to risk this in the Token module, so I think it's a solution better implemented by modules which are able to "know" more information about variables, which seems like a good job for the Variable module.
That said, any variables that would be commonly used are already available under the [site:*] tokens, like [site:name], [site:slogan], etc.
Comment #7
eugene.ilyin CreditAttribution: eugene.ilyin commentedYes, I understand. Thank you.