2. Build menus for pages

Contents

By adding and editing pages using Page module methods, there will be form fields in a Menu area.
This makes it easy to add links to menus, which are about some group of pages (i.e. about Page module entries) by adding and editing such pages.

To make such easy option possible, there must be first added a proper menu to the website.
In this tutorial we will see how to do that.


Log in with admin user, if you have not done it yet.

As an example, we will add a menu for pages for a website called "Manuals".

Click in "Admin General Menu" menu on the item "Add Menu" or go to url [path-to-your-site]/menu/add-menu.

Fill the form fields as described above.

1. Menu name for computer: websiteContent
This is just a unique code for this menu - it is suggested to use a camelCase string here similar to human readable title, but without spaces.

2. Human readable title for menu header: Website content

3. Menu type (horizontal, vertical): "Classic menu, all options open, with title (usually vertical); extended access"
Pay attention to the fact, that the text "extended access" must be included in the option.
There is a detailed description below "Menu type" drop-down menu, but shortly - choosing a menu with feature "extended access" means, that when we add or edit later a page, then we can add easy a link (menu item) to such "extended access menu", which links to this page - see another tutorial how it will be done, when we are adding a page.

4. Menu status (active, passive): Active
Active means that this menu would be visible, if it has a block.

5. Access right for roles: tick all three roles - admin, anonymous, authenticated.
We wish, that everyone would see this menu, even if not being authenticated.
This gives access rights if the menu is shown in content area - when the URL is something like "[path-to-your-site]/menu/view/[id integer value]", but here we can not give access rights if this menu is shown in a block (see below this part, when we add a block to this menu).

6. Caching for roles: don't tick any roles
To keep things simple, we will not use caching at the moment.

Click "Save menu"

Now we got redirected to a page which reminds us that we should add a block to this new menu.
Click the link "Add block!" on this page

Add a new block

1. Block code: websiteContent
Write here the same code, which you gave to the menu.
...
n. Access right for roles: tick all three roles - admin, anonymous, authenticated.
We wish, that everyone would see this menu, even if not being authenticated - this means that this menu would be visible through this block.

Leave all the other block options with default values and click Save.

The menu will be visible when it has at least one item. At the moment it has no items - we will add items later at the same time when we add pages.




Previous: 1. Build menus for module methods | Next: 3. Build general menus
Menus and blocks
1. Build menus for module methods
2. Build menus for pages
3. Build general menus
4. Add menu items
5. Edit a menu item
6. Other Menu module functionality