I'm making a module that changes the output from the tabs (View, Edit, ...) into contextual links. The name of my module is "testmodule" and the name of the theme I'm using is "Bartik".

When I place this into my test module, it works, but only when I use the Bartik theme:

function bartik_menu_local_tasks($variables) {...}

This doesn't work

function testmodule_menu_local_tasks($variables) {...}

Any idea's?

I was also wondering if I could easily change the html made by template.php, for achieving the change of tabs to contextual links I have to change this line in template.php:

<div id="content" class="column">

change into :

<div id="content" class="column contextual-links-region">

I want to do this within my module...


I found a sollution to overwrite the "theme_menu_local_tasks" function.

function MODULENAME_theme_registry_alter(&$theme_registry) {
    if (!empty($theme_registry['form_element'])) {
        // Menu local tasks
        $theme_registry['menu_local_tasks']['function'] = 'MODULENAME_menu_local_tasks';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.