Active
Project:
Admin
Version:
6.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
8 Apr 2010 at 15:29 UTC
Updated:
8 Apr 2010 at 15:29 UTC
In a project I'm working on I needed to differentiate between node types - I wanted some of the node types forms to appear in the default theme and some to appear in the admin theme.
I didn't want to add the capability to the module itself so i thought a better solution will be to add a drupal_alter function that other modules can manipulate it.
Then if a module want to force the admin theme it implements something like this:
function MY_MODULE_admin_condition_alter(&$data) {
if (SOME_CONDITION) {
$data['MY_MODULE'] = FORCE_ADMIN_THEME;
}
}
And if a module want to force the default theme it uses something like:
function MY_MODULE_admin_condition_alter(&$data) {
if (SOME_CONDITION) {
$data['MY_MODULE'] = FORCE_DEFAULT_THEME;
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| admin.module.diff | 935 bytes | gavri |