Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
by
Lessons:33Length:3.7 hours
Drupal 8 1
  • Overview
  • Transcript

3.5 Editing the Main Navigation Menu

The final concept we will cover with respect to views and blocks is the site's main navigation menu. The menu is very important on any site—you want it to be well placed, easy to find, and organized in a way that users will understand. In this lesson, I'll show you how to manually make changes to the main navigation menu as well as how to quickly add menu items.

3.5 Editing the Main Navigation Menu

Another part of our site that has been continually growing in mystery is this whole concept of our navigation bar or our Main navigation menu bar. Now, the way that we've interacted with it so far has primarily been when we are either adding basic pages or maybe creating custom views. That's how these menu links or these tabs are showing up within our Main navigation. Now, that is absolutely one way that you can go about adding these buttons to our navigation. But you can also do it and manage these links in these buttons up here in a much more controlled fashion. And as you may have guessed to this point, we are going to go back into Structure and we're gonna come down here to Menus. Now within Menus, there are obviously several different areas or types of menus where we can start to modify some of these things. And a lot of these are defined and shown within the block diagram that you saw before of the location or the regions that are defined within the blocks. But for the most part, we've been dealing with the Main navigation, so let's stick with that to this point. So we can come over here and click Edit menu, and you're gonna see exactly what we see within our Menu bar. So now within here, we can do a number of different things. We can enable or disable buttons. We can edit these links. We can add new links, should we choose, even though that is a little bit more complex, but it is definitely doable. So there's a number of different ways we can make modifications here. We can change the order of things, so maybe we want Home to be at the end, or we want Latest Content to be first. So we can go ahead and Save that, if we would like. And we could go back to our site and we could see now that Home comes second and Latest Content comes first. Now, maybe that doesn't make as much sense. But it does serve a purpose to know that I can come in here and I can modify my Main navigation menu with respect to how many different links I have here within my site. So let's put Home back in the beginning and go ahead and click Save. Now one feature that is very interesting when it comes to the navigation links within your site is what if I wanted to create a submenu? Well, that's very easily done within our Edit menu within our Structure > Menus section. All I would need to do if I wanted to create a submenu is I could grab this. And instead of dragging it up or down, I could simply drag it in. And the fact that I dragged it in, makes this as a submenu of Home. Now, this is not actually going to work the way that you would think it was. But let's go ahead and hit Save anyway, and we're gonna come back to our site. And now we see that we only have two menus in Main navigation here, we have Home and About. So I could click Home, and what exactly happened to my Latest Content link? Well, it's not going to show up here and the reason for that is very theme specific. Not all themes out of the box support submenu. Some of them do, some of them don't, that's just the way of the world. So I'm gonna go back into Structure and I'm going to go back to Menus, into my Main navigation and I'm gonna bring that back out. So just so you know, that's how you can very quickly and easily create submenus for themes that actually support them. So let's go ahead and hit Save. Now, you can manually go in and add links. And when you click the Add Link button, it's going to ask you what the Menu link title is and where this link is going to go. Now, you can kind of build these things out a little bit more easily. I can start to type a piece of content that I want to select, if I so choose. So I could start typing in maybe my. And you're going to see now that it's going to find all of the content defined or any of the nodes define within my site that have the word my in it. So I can come in here and I can grab one of these and I can say maybe My First Article, because it was very great, and it's gonna give this a node idea 4. And I can give this a Menu link title and say My First Article, even though it doesn't technically have to be the same text as the actual link itself. And we can say this is gonna be Enabled, no Description. The Parent link is gonna be within the Main navigation, Weight is gonna be 0, and let's go ahead and Save that. So now it's going to show up in here as My First Article and I can drag this around a little bit. Maybe I'm very proud of that first article and I want it to be right after Home. So we can go ahead and hit Save, and now I can come back into my site, and we're going to see My First Article. And I can click that link and it's gonna take me directly over to the full content view of that particular article. So that's kinda the quick and easy way to be able to go and find an existing node within my site and add a link to it. Now, there is another way to do it and it's kind of quite common actually to find something within your site that you really like. And maybe it's a article, maybe it's something else, maybe it's a forum or what have you. And you can navigate to it. And I could come up to the URL bar here and I could grab the relative location of this. So I can grab this /node/48 and I could copy that and I could go back into my Structure. I could go back into my Menus. I could go ahead and go into my Main navigation, and I can edit this, and I can once again add a link. So instead of actually typing out something that I want, I could actually use the structure of the path that I want, and I could come in and I could paste this in. And I could say Some Content, like this, for a name and this could be the link. And once again, I could come and Save that as well. Some Content is here, let's drag that up a little bit, let's go ahead and hit Save. And now when I go back to my site, I'm gonna see Some Content. And as you can see, it is actually a link to that specific one that I found. So I can very specifically grab the relative path URLs of the location within my site that I want to create a link to. Or I could add it by typing in some sort of letter that's found within the title of that particular node of content.

Back to the top