Load 'translate node screen' in admin theme

13 Sep 2011

Joris Snoek - Business Dev
+31 (0)20 - 261 14 99

On multi-langual websystems, Drupal can provide you wih a translation overview of a node you want to translate. So you can see to what languages the node is translated and what not.

For example "node/10/translate". Here you can pick what language you want to translate the current node to. It can be an issue that Drupal shows this, out of the box, in your selected Frontend Theme, thus not your choosen Backend theme (set this up at: admin/settings/admin).

Here is a simple piece of code that can solve this problem, add it in a custom module:

The allmighty code

/**
* Implementation of hook_init().
* We use this to get the core translate overview in backend theme.
*/
function MODULENAME_init() {
  if (arg(0) == 'node' && arg(2) == 'translate') {
       global $custom_theme;
       $custom_theme = variable_get('admin_theme', 0);
  }
}

The installable module

Next week we'll have this module available for ya'll! Hopefully also on Drupal.org
Can't upload right now, because we have to tune our Frontend theme for file downloads ^-^

Feedback? Questions?

Please hit me on Twitter for all your feedback, and any other issue!

Comments

Nóg meer
kennis nodig?

Check ons ons blog archief >