# Drupal Commons menu items adjustments — Liran Tal

Using hook_menu_alter() to adjust menu items in Drupal Commons

Canonical: https://lirantal.com/blog/2012-10-05

![Cover artwork for Drupal Commons menu items adjustments](/_astro/photo-1468956398224-6d6f66e22c35.BePqp3CW_Zj88Tk.jpg)

With commons you mostly feel like you’re always eating a mixed salad. You get a lot of Acquia’s custom features and contributed modules, which all of it builds up a specific distribution type.

Salads lose their appeal when you need to dig in and seek for a specific item, which was the case in a recent fiddling with it. Commons provides a ‘bookmarks’ link in the user’s Profile area underneath the user’s avatar, along with a bunch of other links and we needed a way to pull it into the tabbed links menu. One would wonder how to approach that?

Just by looking at the existing menu items, it’s easy to spot that they are all part of the same hierarchy and the menu system. Assuming that the menu items were done sanely, meaning no one at Acquia hard coded these links or used a custom menu hook, then they were probably declared in `hook_menu()`. Where exactly is another question and while you may choose to seek this out it doesn’t really matter. Lucky for us Drupal declares a `hook_menu_alter()`, which if you implement in the lowest priority module (read: highest numeric value for module’s weight in the system table) then you can easily throw in there a debug break point that looks at the `$items` of the menu and locate that particular entry.

Doing that, yields the following (more or less):

```
[user/%views_arg/bookmarks] => Array
(
[page callback] => views_page
[page arguments] => Array
(
[0] => flag_bookmarks_tab
[1] => page
[2] => 1
)

[access callback] => og_features_menu_access_callback
[access arguments] => Array
(
[0] => views_access
[1] => views_page
[2] => Array
(
[0] => flag_bookmarks_tab
[1] => page
[2] => 1
)

[3] => views
[4] => user/%views_arg/bookmarks
[5] => Array
(
[0] => views_check_roles
[1] => Array
(
[0] => Array
(
[2] => 2
)

)

)

)

[load arguments] => Array
(
[0] => flag_bookmarks_tab
[1] => page
[2] => %index
)

[title] => Bookmarks
```

As suspected, the bookmarks menu entry is simply not configured as a local task for the tabbed menu. To elegantly customize this you can create such low priority custom module to implement `hook_menu_alter(&$items)` and alter the menu item type, such as:

```
 $items['user/%views_arg/bookmarks']['type'] = MENU_LOCAL_TASK;
```

Clear the cache to test and confirm.

## More writing

[All writing](/blog)

*   Sep 5, 2026

    ### [Self-Hosting Hermes Agent with Matrix E2EE on Proxmox](/blog/self-host-hermes-agent-matrix-e2ee-proxmox)

*   Aug 2, 2026

    ### [The Practical Second Brain: Building an LLM-Operated Markdown Knowledge Graph](/blog/practical-second-brain-llm-markdown-knowledge-graph)

*   Aug 1, 2026

    ### [Building a Second Brain with LLMs and AI Agents](/blog/building-second-brain-llms-ai-agents)


* * *

Liran Tal is the author of the book [Node.js Secure Coding: Defending Against Command Injection Vulnerabilities](https://www.nodejs-security.com/)

[Start Building Secure Node.js Applications](https://www.nodejs-security.com/)

 [![](/_astro/nodejs-secure-coding-book-3d-style.DiTWpzFs_Z3c7s1.png)](https://www.nodejs-security.com/)
