I have a function in my template.php file but I've now created a module that manages these particular tasks so I want to move the function over.
This is what I have in my template.php file:
function MYTHEME_menu_tree__main_menu($variables){
return '<ul class="menu my-class">' . $variables['tree'] . '</ul>';
}
This works file but when I move it into my custom module (mymodule.module
file) if doesn't work.
I've tried this:
function MYMODULE_menu_tree__main_menu($variables){
return '<ul class="menu my-class">' . $variables['tree'] . '</ul>';
}
and this:
function MYMODULE_preprocess_menu_tree__main_menu($variables){
return '<ul class="menu my-class">' . $variables['tree'] . '</ul>';
}
but not happening.
Can anyone see where i'm going wrong? or am I way off on this and it can't be done like this?
hook_theme_registry_alter()
and replace the callback function for that hook; the naming convention for overrides only works for themes