When editing/adding/removing tab links to a Node page (View/Edit) is there a quick way doing this with a hook_preprocess
method and not via creating a module to alter them? Such as using hook_process_page()
and then editing the $title_prefix
array since this is where they are stored.
Example: I created a module for editing the contextual links, but what if I wanted to skip creating a module and directly inject my changes in the template.php
via hook()
.
function mymodule_contextual_links_view_alter(&$element, &$items) {
$element['#links']['new-links'] = array(
'title' => 'Add something new',
'href' => url('/admin/config/add/something/new', array('absolute' => TRUE)),
);
}