Add support for menu path without the title

Badger - September 2, 2009 - 14:40
Project:Token
Version:6.x-1.x-dev
Component:Token Actions
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

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 /.");

 
 

Drupal is a registered trademark of Dries Buytaert.