Drupal Association members fund grants that make connections all over the world.
Creating contextual menu items
Menu Token module allows to insert tokens into menu items title and path.
We are going to create a list of all articles published by the authenticated user using the Menu Token and Views modules.
- Create a view with context arguments.
- Create a dynamic menu item
Go to Structure > Views and create a new view named "User Articles" that show "Content" of type "Article" and has the path "/articles".
Then we need to configure the view to shows the node title and body summary.
Also we need a Relationship with the author of the article to be used in the contextual filter.
The key configuration step is add a Contextual Filter for the user name. With this filter we can filter the node author.
When the filter is not specified in the URL the view doesn't the shows any result.
Then check the “Override title” option and use the first argument to override the title with “%1's Articles”. Change the “Case” option inside the “More” field set to Capitalize first letter.
Go to Structure > Menu, create a new menu and add new link. Check the option “Uses menu token”. Open the node Current User and pick the current-user:id options. Now that option you selected is in the path field.