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.
Hi
I have a normal menu inside a block on my front page. This menu contains one menu item.
I want a token in this menu item that gives the number of all nodes of a specific content type the current user made.
How can I do this? I found [node:content-type:node-count] but how can I tell the computer which content type i mean? Once again: I don't want the user to see the number of all nodes of a content type, but ONLY the number of his own nodes of this content type.
Thanks very much for your help.
Regards, Nico
Comments
Comment #1
Dave ReidYou can't really use tokens in this way. You'd have to provide token_replace() with a node object in order to replace the token with the correct number, which is something you can't really do with menu links. Your best bet is to alter the menu links with a custom module yourself, possibly using hook_translated_menu_link_alter().