Posted by Frippuz on September 2, 2009 at 2:40pm
Jump to:
| Project: | Token |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
Why?
I wanted to add content in a menu at one occasion and without menu in another. I had to choose between [menupath] and [title]
If I added them both I got the title two times.
What I needed was a token that added the menu-path without the title itself, doing that I could use [menupath-no-title]/[title]
which wouldn't add any menu items at all if the node wasn't in a menu, but would add the path if it was indeed in the menu.
I've added the support for this myself by adding a new token [menupath-no-title] and the following code:
line 86: array_pop($trail);
line 87: $values['menupath-no-title'] = implode('/', $trail);
line 217: $tokens['node']['menupath-no-title'] = t("The menu path (as reflected in the breadcrumb), not including Home or [menu] or the item title. Separated by /.");
Comments
#1
#2
This is a duplicate of #519834: A variant of [menupath-raw] which excludes the current node, or a token which provides [title-raw] when [menupath-raw] is empty.