Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
As much as I love Drupal I disagree with its some parts of its design. One of those parts is the default Navigation menu, which makes use of every part of the pig except the squeal. So on my site I replaced with it a custom menu that was shorter and discover just how useful custom menus are in general whether you use them to replace the Navigation menu as I did or for some other purpose. Let us go to my site and take a look at that. One of the things I did was I combine the name of the person logged in with the log out command here. I did this through a PHP code snippet that I got from drupal.org. We will show you how to do that in another part of this series. If we switch back to out original site you will see that the name of the person logged in and log out are in two different places and I thought that took up too much space.
Let us built a similarly simple Navigation menu for our site. We are just going to have two items in it; blogs and feed aggregator. Of course you can put in what ever items you like. The next thing to do is to figure out what URLs we go to when we go to click on those items. So, let us do it. Click on Blogs and we go to \blog. Remember that because we are going to be using it in minute. Click on Feed aggregator and we go aggregator. Once again we have to remember that. Another way to tell what the links are is to look in some browsers which have information area, for example in Fire Fox when you hover a link at the bottom of the screen down here, it tells you what that link is where you are going to go. I am switching back now to Safari so I can look at my administrative interface.
To add our custom menu we go to Administer and then Menus. From here we go to Add Menu. First, the menu name. This is going to be the machine-readable name of this menu. When you enter a machine- readable name it is best not to have any underscore or spaces because the machine won't understand them. The specific details about what machine-readable is are given underneath the entry field, but we will just keep it simple and call it new Navigation. For the title we will just call it Your menu and will leave the description blank for now. This part at the bottom about the ID for excluding and including this element is actually an advance topic, which we won't be covering in this course. We click on save, good. Now, let us take a look at all of the menus by again going to Administer and Menus. There it is there is our menu. We click on it and now we can start adding items to it.
You remember we wanted to have two things there, the blog and the aggregator. I will add an item and here we enter the path. This is going to be the URL where we go when we click on it. You do not have to put that leading slash so we just put log for the blog and then in the menu link title I am just going go say logs. For description we will enter what we are thinking now. We will have it enabled and we won't have it expanded because I do not want to show that my blog. It is just going to be a simple menu. The parent item tell us where this menu items going to go, since we created it coming from the Your menu choice it decides of course we are going to put it in Your menu, but we could decide at the last minute, oh no, we want to put it in the Navigation menu underneath Site Configuration in which case we will change the pop up menu to there. But we are not going to do that.
Weight controls are how high or low the items appears on the menu and we are just going to click Save because we only have one item here. Good! We have created out first item now we will create our second one, that feed aggregator, we do the same process again add an item. Remember the path we were going to is aggregator and the Menu link title, I do not like Feed Aggregator no one knows what that means, so I am just going to say News, and for description I will say all that fit to feed. Again we will leave that enabled but not expanded same here same here. Leave it as it is and click on Save. And our menu has been created. But where is it, we do not see it anywhere up here. That is because when you create a menu it is created as a block and you have to enable it some where on your page.
Let us do that now we do so by going to Administer and then over to Blocks. You see the Navigation menu is right here, if we scroll down we see that menu that we just created called Your menu is down in a disabled area. We are going to move that up to the left sidebar and Save it. Now, we have both the Admin menu here and Your menu down here at the bottom we do not really need both. So I am going to get rid of the Navigation menu at this point. Go to None and that gets rid of that and then I am going to move Your menu up to the top.
Once again we go to the bottom of the page, Save Blocks, there we now have a very simple menu up here instead of the Navigation menu. I am actually going to change it back. To do so we just reverse the process. Take Your menu, make it None, scroll down to the Navigation menu, make it left sidebar. Save your blocks and then move it around to wherever you wanted, it. It was originally underneath user log in which only shows up by the way when you are not logged in. Scroll to the bottom, Save Blocks and we are back where we began. A lot of what makes the site attractive is having a clear Navigation path and being able to create customize menus makes that goal possible. In designing menus I recommend that you be as spare as possible but be prepared to invest time in figuring out which menus are really important. The best way to do that is with user testing, watch where people actually go the most and make menus so they can go there easily.
Less is more, and to repeat one of my favorite quotes, making it easy is hard.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.