Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Sometimes I need to display user tabs sitewide, but they are path-dependent (user/*)
This can be archieved by altering $_GET['q'] value, while getting menu_local_tasks();
I've made a small patch, to provide "local_tasks_blocks_fixed_path" setting with token support (using user/[current-user:uid] for example above)
This can be handy for some situations
Comment | File | Size | Author |
---|---|---|---|
#1 | local_tasks_blocks_fixed_path.patch | 1.87 KB | player259 |
Comments
Comment #1
player259 CreditAttribution: player259 commentedComment #2
jay.dansand CreditAttribution: jay.dansand commentedI like it! Here are some quick notes before it can be a candidate patch to merge in:
#description
in the form for describing what setting the fixed path means and does.token_replace()
check/call inside of the check for!empty($fixed_path)
(also: using!empty()
instead of just testing "if ($fixed_path)
".)