Tutorial on Basic Nav, Hierarchy Nav, Blogroll, Separate Blocks for Nav for Newbies

Last modified: June 22, 2008 - 00:39

A Four Part Tutorial on How to Set up A Basic Navigation, A Hierarchical Navigation, Separate Blocks for Your Navigation and A Blogroll using Drupal 6.1 (Garland Theme)

I wanted to set up a basic, hierarchy site nav for my site, but I found all the posts and documentation that I read so confusing and (forgive me pls.) over-geeked that I was ready to give up. Surely it couldn't be this difficult for the most basic function of a site. And it's not. In truth, once I 'saw' the answer, I was appalled at how easy it was, and how close I had come to throwing the whole thing out.

This is how it is done, as close to step by step as I can make it. I will say this before you begin. Go through the steps. You will learn as you go, and once you start to see your results, you will begin to catch on how to go about the rest, or how to change it, or how to make it do EXACTLY what you want. But go through the basics, till you understand it first.

Also, remember that you MUST CREATE ACTUAL CONTENT for most of your links to begin to show up on your pages. However, the structure will be there for when you do.

SETTING UP THE BASIC, FIRST LEVEL NAVIGATION.

Go to Admin > Menu
Select Primary Links

Primary links are the links that will show up in both the blue banner bar of the Garland theme, as well as in a separate block in the BLOCKS section of Admin which you can toggle to go in whatever location you would like. If you do not want any links in the Blue Bar at all, then simply go back one page to Menu, and select Add Menu for your links. This tutorial assumes however, that you want at least a few links to show up here, i.e. Home, or About Us, or Contact.

To return to the steps. On the Primary Links page:

Select Add Item.

You will get a page that asks you for Path, Menu LInk Title, etc. For Path: type in node/add. For Menu Link Title, type in the name that you want to show as the Link. i.e. Home, or About Us or whatever link you want.

*NOTE concerning the Path URL:
This I just realized ~ When you type in node/add as the Path URL, all the links that you create under Primary Links that show up in the Blue Banner bar of the Garland Theme will show up to your users (including you as the Admin) as links to 'create content' according to the content that they are permitted to create. This condition is only for the links that show up in the Blue Banner Bar. It does not pertain to the links that will show up in your sidebar under the Primary Links Block. If you do not want this (the create content link), then you will have to change the Path URL to node/(node number) according to the instructions further on in this tutorial on how to find the node number. You can also change this Path URL at any time through the edit function once you begin to create content, and so change the target of your links then.

You can add a description that will show up on a mousehover if you want by filling in the description box. You can also fill this in later if you want, as you refine your menu's and links by using the edit functions.

Going down the page ~

Toggle Enabled. This will make your link show up. Ignore Expanded for the time being. This for if you want your Navigation to be always in the expanded state (toggle ON) or closed, and expanded only when clicked (toggle OFF).

Parent Item: Select Primary LInks. This will set the links to show up in the Primary Links Block, as well as in the Blue Banner of the Garland Theme.

Save.

Keep adding Items in the Primary Links Menu until you have the links that you want for your Primary or First Level Navigation. You should see these same links showing up in the Blue Banner of the Garland Theme as you save them.

Now: Go to BLOCKS.

Locate the Block that says Primary Links, and toggle it to show up in whichever area you want it to show up in. This menu list will show up where you place it, and it will be a duplicate of the one that also shows up in the Blue Banner of the Garland Theme. If you do not want a duplicate, you can skip this step. Likewise, if you want to break up your Primary Nav into separate blocks, you can skip this step and follow the tuturial for this procedure further on down the page.

SETTING UP SECOND LEVEL NAVIGATION:

Go to Admin > Menus > Primary Links.

Select Add Item

Fill in Path (use node/add) and the Menu Link Title should be what you want the name of the actual link to be. Enter the description as you choose, toggle Enabled, and now you come to :

Select Parent Item. Scroll through the list, and find the Menu that you want this link to be set under. Choose that and you now have your second level hierarchy.

For example: You set up a Primary Link called About Us. Now you want to set up subsections under About Us. Toggle About Us, and your new subsection that you just created will show up here. If however, all you want to do is just list separate pages under About Us, you can do this through the page creation process and you do not need to set up a second level navigation.

You can continue doing this for each subsequent level to a depth of nine levels of hierarchy. Each Item you add under node/add as the Page url, you are essentially creating a 'folder'.

BREAKING UP YOUR NAVIGATION INTO SEPARATE BLOCKS

Not everyone wants their navigation to be one long list down the side, on all pages. Some would like to break up this navigatin and distribute it on the page, especially if they have a two column theme, as Garland does. There are a number of posts in the forums asking how to break this up and have only certain blocks on certain pages. This portion of the tuturial will tell you how to break up your basic navigation and do this very thing.

Go to Admin > Menus > Add Menu

Select Add Menu.

You will see a page that has Menu Name, Title Name, a place for a short description, and a Save button.

The Menu name will be an internal ID name, all lower case letters with no spaces. Title Name will be the Title of the Menu. This title will also show up as a Block on the BLOCK section of your Admin. It will be the title of the Block of Nav you want to show up on your pages.

Add your description if you want. This description is for your benefit, and will show up on your Menus Page. SAVE.

You should now be back on the main Menus page, and your new Menu should be listed there with your description, if any, underneath it.

Select your Menu that you created. You should now be at a page that has the name of your Menu at the Top.

Select Add Item.

Go through the same proceedure that was listed at the beginning of this tutorial, the way you did to create your primary links, and list all the particular Link Titles that you want to show up in this block. SAVE.

Go to BLOCKS.

Locate your Blocks that you just created, toggle them to go to whichever location you want them to go on your pages. SAVE BLOCKS. These blocks will now show up on all your pages according to the locations that you have selected.

Want to have only certain blocks show up on certain pages?

Go to the block that you just activated on the BLOCKS page, and Select Configure.

You will now see a page that asks you for:

Block Title: This will be the title that you gave the block in the Menu. If you want to override this and use a different name, you can do so here. If you do not want the name to show at all, you can enter . Overriding the name does not change the name, it merely overrides it for the purposes of the block.

Select your configuration settings to suit your need.

Now you will reach the portion that says: SHOW block on specific pages.

This is where you can toggle to eliminate pages, or you can toggle to select certain pages for this particular block to go on. If you want a Blogroll to go only on blog pages (next section will tell you how to do that), then enter into the space, blog/*. The * is the wildcard that will select all blog pages.

If you only want the block to show up on specific pages, this is where you add that page. To do this, call up the actual page you want the block to show up on and look at the address bar. It will give you an address that will end in node/___ with ___ being a number. Enter this number into the SHOW block space on your block configuration page as simply node/35 or whatever your node number was. You will now have this specific block show up on only that particular page.

If you chose page/* then your block will only show up on content created as pages. Likewise with books, forums etc. If you only want it to show up on certain pages, then you will have to find their node numbers and add these in.

SAVE your configurations, and that is it.

NOW, you will have to start creating content if you want any of your blocks to start showing up. Once they start showing up, you will begin to 'see' how it works, and can alter or adjust your navigatin to suit your taste.

As a word of advice, DO NOT USE the 'NAVIGATION' Menu to set up your links. This is the default navigation for all your site permissions according to user. You can toggle this block to be where you want it to be through the BLOCKS menu, or you can have it not show up at all, by untoggling it.

Any of the Menu items that you want to move around, you can do so through using the drag and drop handles on Drupal 6.1 or through using the 'weight' function on Drupal 5.7.

If you try to use the Secondary Links, what you will end up with is by having your secondary links show up on the Blue Banner of the Garland theme. They do not necessarily show up under the primary link, and they are not drop downs either. As such Secondary Links is not a menu that will accomplish your purpose in setting up a basic nav with a hierarchy. What else you would use it for, I do not know. Using Primary LInks has resolved the Nav and Link issue admirably.

HOW TO CREATE A BLOGROLL OF EXTERNAL LINKS. (again, using the Garland Theme)

Go to Admin > Menus > Add Menu

Your Menu Name is an internal ID number that should be all lowercase with no spaces.

Title Name is the title that you want to call your blogroll.

Enter a brief description if you want, and SAVE. You will be taken back to the Main Menu's list. The name of the menu that you just created should show up here.

Select your new Menu.

Select Add Item.

You will now see a page that asks for Path, and a Menu LInk Title etc.

In the Path area, enter the full URL that you want for your blogroll link.

In the Menu Link Title, enter the name you want to appear on your blogroll.
i.e. Path could be #http://www.abcdefg.com# (the #'s are so it won't show up as a link, I hope) but the Menu Link Title could be Tiny Tots which when selected will take you to abcdefg.com

Add a description of the site link. A brief word of what you are linking to.

Toggle Enable

Ignore Expanded, unless you want to repeat the steps of a hierarchy (maybe someone has multiple sites)

Parent Item: Select to the name you gave your new Menu or blogroll. If you ARE creating a Blogroll hierarchy, repeat all the same steps for creating a Nav hierarchy and set it to the parent item that you want it to show up under.

Weight can be set optionally, or you can use the drag and drop handles on the Menu page to set the order of your links.

SAVE.

AND THAT IS IT! No coding, no extra modules or plugins, all basic and straightforward.

As you begin to see it in action, and you begin to add content, you can play around with it, and tweak it to your hearts content (i.e. adding CSS and the like).

Outstanding tutorial for beginners

gavstah - August 21, 2008 - 12:54

This is a great tutorial - got me up and running with a solid site nav layout in no time at all. Kudos!

 
 

Drupal is a registered trademark of Dries Buytaert.