Creating and Editing Menus in Drupal
The following tutorial is to help those that are new to the Drupal content management system learn the basics of the Drupal menu system and the Drupal block system. It should be pretty easy to figure out, but for some reason I left something out, or if you have any questions, please don’t hesitate to leave a comment and I will try to respond.
Most of the time when you create menus in Drupal you will be linking to internal pages on your site that you have created. You can also link to external web pages, and the basic process is the same. To start go to the Menu page at admin/build/menu. The Menu page shows the listing of all the menus that are available to be activated in your Drupal website.
At the top of the page you should have four tabs; list, add menu, add menu item, and settings. To create a new menu click the “add menu” link. In the add menu page you will have one field to fill out called title. This is where you give the new menu its name. Call it whatever you want and click submit. When you return to the Menu page your new menu should appear at the top of the list. It has nothing in it yet; the menu itself is just a container to hold the links that you will put in it.
Under the title of your new menu there should be three links: edit, delete, and add item. Click the add item link that is under your menu and it will take you to a new page. The default fields for adding a link are as follows:
- Title – This is where you enter the text that will actually be visible in your link.
- Description – The description text causes a box to appear with the description of the link when a user hovers over the link. For those familiar with html the description is really just the title tag.
- Path – The path is the actual destination of the link that you are going to create. If you are linking to a page inside of Drupal then your path will be either all of the text after the name of your website if your site is only in one language, or it will be all of the text after the language name in a multilingual website. For example for http://www.translationdesigns.com/mypage the path that you would enter into the menu would be “mypage.” For a multilingual site such as http://www.translationdesigns.com/es/websites the path would only be “websites.” Notice the “es” in the url. The “es” refers to the language of that particular page, in this case Spanish. For the English version of the same page the link would be the same except it would have an “en” instead of an “es,” and the French version would have an “fr.” Note if for some reason you are in an English page and you wish to link to the French version of a particular page all you need to do is include the fr into the path. So the path to the French version of the “mypage” page would be “fr/mypage.”
- Expanded – Some menus are multileveled with sets of links under the first link. If the parent link, or main link, is not expanded then the sub-links will remain invisible until the user clicks the main link. If the main link is set to be expanded then the sub-links will always be visible.
- Parent item – This is where you decide if you want this particular link to be a main link inside the current menu that you are creating, or a sub-menu for another menu item that you created already, or even to put this menu item in another menu all together. You may have to play with this a while to really understand it fully, but once you get it it’s easy.
- Weight: Weight is the system that Drupal uses to determine the position of the link in the list of menu items. The lower the number the higher the menu item is positioned on the list. -10 is the highest point on the menu, positive 10 is the lowest. Multiple menu items can have the same weight, it won’t cause any problems. If there is more than one item with the same weight Drupal will determine the weight of the link based which item was entered first. There are rumors that the new menu system in Drupal 6 is going to do away with the weight system eventually in favor of an even simpler drag and drop interface.
Once you have your menu item created and have submitted it you should now see it under the new menu that you have created. If you need to edit any of the links in the menu click the “edit” link to the right of that particular menu item and it will take you to a page where you can edit the link.
Now that you have created a menu and have the links pointing where you want them to the next thing you need to do is to activate that menu in a block. Please read our Drupal block tutorial if you need help working with blocks.



Enviar un comentario nuevo