I would like to submit and maintain a module I have written called linkedtheme. It allows linking one theme to another in order to synchronize block settings between the two themes. It is similar to blockregion, but differs in that blockregion copies blocks to all themes.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | linkedtheme.zip | 4.63 KB | jemmyw2 |
| #5 | linkedtheme.zip | 4.42 KB | jemmyw2 |
| #2 | linkedtheme.zip | 4.49 KB | jemmyw2 |
Comments
Comment #1
avpadernoWhy didn't you open a feature request for that module, or created a patch?
Comment #2
jemmyw2 commentedAfter looking through the code for blockregion I felt that the functionality I needed was sufficiently different to start a new module.
Comment #3
avpadernoRemember to change the status, when you upload new code.
Comment #4
avpadernoThat is not the correct way to get the theme for which the settings should be applied.
There is a Drupal function that should be used to get the placeholders of many arguments; the code could then use
drupal_write_record().Schema descriptions should not be passed to
t()anymore. See system_schema() for an example of what done by Drupal core code.Comment #5
jemmyw2 commentedThanks for your feedback, I've addressed all of the described issues except for number 2: I'm not sure what the correct way to fetch the theme in this function as referred to here. Could you provide a hint on a better way to fetch form arguments from form_alter?
Comment #6
avpadernoThere a value contained in
$formthat can be used (it is something like$form['#key']). I know that because I once created a custom module that I used to alter the theme settings page, but unfortunately I have not the code anymore, as the most important change I was trying to make was not working.I can tell you that such value must be modified, and it is the exact contrary operation that system.module does.
Comment #7
jemmyw2 commentedLooking at a var_dump of $form the only place I see the name of the theme is in $form['#parameters']. Following the code through from drupal_get_form this seems to be where the original unmodified form arguments are stored.
Comment #8
avpaderno$form['#parameters']is added from Drupal core code and, as it is not declared in any API documentation, it should not be used, also because it is not said that what the code should use is always in$form['#parameters'][2].The correct way to proceed, for the theme settings form, is to use the value contained in
$form['var']['#value'], as it also done from Theme Settings API.Comment #9
jemmyw2 commentedThanks, thats great, I've updated the module to use the correct method of getting the theme name.
Comment #10
avpadernoComment #13
avpaderno