Drupal 7 Tutorial Part 7: Understanding Drupal 7 Menu Concepts -- Default Menus

posted Jun 23, 2011, 2:35 AM by admin@ revitviet.vn

Hi Drupalers,

Till now we understood nodes, blocks concept in Drupal 7.  It's time to look into drupal menu system and understand various settings related to drupal menus.

Drupal 7 is very powerful and it even allows a naive user to create a beautiful website. For each and every website menus play an important role. In this series of menu tutorials i would like to explain below mentioned features related to Drupal Menus.

  • Drupal Default Menus
  • How to create Menu
  • How to add links to the Menu
  • Menu Blocks

Drupal Default Menus:

          By Default, Drupal 7 comes with 4 different menus which facilitates easy navigation to admin related  pages and other pages. In this, some are visible to only administrators and others to normal users. Let's see in detail about default menus and their settings.

          To navigate to menu's list, login as administrator and click on Structure link in Management Menu (Black Menu Bar as shown below). Once you click, you will see Menus link. Click on menus.


      Once you click on menus link you can see list of menus available by default in Drupal 7. You can see something like below.


  • By default Drupal 7 comes with 4 different menus that contains various links. Let's check it out one by one.
Main Menu:

   Basically, main menu is used on many sites to show the major sections of the site, often in a top navigator bar. For example, for my site main menu consists of 4 links Home, Drupal 7 tutorials, VIDEOS, Contact Me. You can see main menu top of this page.

  In Drupal 7, default main menu consists of one link to home page. When you click on list links text next to main menus section as shown in above image, you can see list of links in the main menu bar. List of links in main menu looks like below screen.


  •    Let's add a new link called About Us to our main menu list and let's see where it appears in the screen. Click on Add link text in above image to create a new link in main menu.
  • You will see form like below image to create a new link in main menus. Let's examine each and every setting.

  • Menu link title -- This text field basically holds the label of Menu Link. Please fill this value as "About Us"
  • Path -- Actual link path. This can be relative path to your site or can be external url that starts with http://www.example.com. Since we are linking to same site, let us give relative path as node/1 which we create in node tutorial.
  • Description -- This text will be shown when user hover on the link we gonna create. Let's give this field as "About d7.com".
  • Enabled -- This check box is used to hide or display menu link in the menu. Leave it checked default.
  • Show as expanded -- This is used when link contains child items and you want to display children by default. Let's learn more about this in upcoming tutorial.
  • Parent Link -- Parent of the link we are going to create. Leave it as it is. Let's learn more about this in creating parent - child relationship in upcoming tutorial
  • Weight  -- order of the link. Let's leave as it is. I will explain more about this in upcoming tutorial.
  • Click on Save button to create about us link in main menu.

  • As shown above, now main menu contains two links namely, About Us and Home
  • When you hover on About Us link you can see About d7.com which you provided as description when you are creating link,
  • Like main menu, Drupal 7 comes with three other menus which are basically shown in below image. You can add or remove links in other menus also just like you did for above main menus.

Hope you understood basics of drupal default menus. Let's learn more about menu settings and creating a new menu from scratch in my next tutorial.

 

Cheers,

Anil Sagar

Comments