The Menu Link module is included in Drupal core. When enabled, the Menu Link module can be used to allow users to create menu links.
- Information Needed
Site administrators can:
- Information Needed
Issue Queue for 8.x
So here we go. We are new to Drupal and we want to build our first very simple website. In this tutorial, we assume that you already have Drupal core installed and a basic installation running. You know how to install new modules. We also won't look at how one can theme his website.
First of all, for gain of time during all the project, install the admin menu module. Disable the core Toolbar module. You have now a new drop-down administration menu at the top of your site.
Note that this step is not strictly necessary but just make things easier. Most of the people use this admin menu instead of the normal one.
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.
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.
Deleted as it is considered as to be "too long and rambling".
Will be published elsewhere ....
Author's note: the Context section of this page would benefit from screenshots. During the presentation, I was able to demo the options, but obviously that doesn't work as well with static docs. I'll add them myself in time, unless someone beats me to it. End Note
Blocks and Menus
Every time you create a menu, a corresponding block is created that displays that menu.
You can also create custom blocks at admin/structure/block/add.
Now that we have these blocks, we need to display them.
The two commonly used methods of controlling block display are the core block display functionality, or the contributed Context module. Both means achieve the same goal; the context module provides more flexibility.
Core Block display
The core block visibility settings can be accessed at admin/structure/block.
To display a block in a region, use the drop down menu for the block you want to show:
In addition to setting the region for a block, you can also set additional features by using the "configure" link visible in the above screenshot.Read more
Now that we have created ways to find and browse information on the site, we need to create links that allow people to find these places.
Enable Token and Menu Token modules
Create a blog menu at /admin/structure/menu/add
Click Add link put links in your menu.
Configure your menu link as shown below. The token replacements are generated by the Menu Token module.
Add in a second menu link to point to the "Sitewide Articles" page we created earlier.
Finally, add in a link in the User menu to the Activity tracker we created earlier. Use a token to add the user id of the current user to the end of the menu link.