In the previous installment of this series, we learned all the details of Drupal’s Content Management. Now we’ll get into Blocks and Menus, which are the meat and potatoes of the Site Building section.
To get to the main Drupal configuration menu we’ll be working from, you should visit http://YourSiteURL.com/admin/build/ in your favorite web browser, or http://127.0.0.1/admin/build/ if you’re working on your own local computer. We’re also assuming you’re logged in as Drupal’s administrator. That will get you to a menu that looks like this, containing four submenus:
Blocks: The first thing you will discover when you enter this first submenu is that it’s loaded with unfamiliar terminology. Garlands? Blocks? Regions? Pushbuttons? Don’t panic, all will be explained.
In Drupal, a “block” can be thought of as a container for content; instead of coding up something to display an RSS feed and manually putting it into a theme, you can manage it all right here. It’s similar to a widget in WordPress, except that in Drupal the concept works everywhere (not all WordPress themes support widgets). New blocks can generally be created by modules, which are add-on programs similar to WordPress plugins.
A “region” in Drupal generally refers to any major fixed area on the page: the header, footer, sidebars, and even the page content are all regions. The end result is that you can easily assign a block to a region, and quickly redesign the look of your page from this submenu.
What about Garland and Pushbutton? These are the names for the basic themes included with the minimal installation of Drupal, and they just happen to be nouns, which makes their appearance on this submenu a bit confusing. But once you understand that they’re themes, you also realize that Drupal lets you configure and save your block/region layout for each theme separately. Just click on the name and Drupal will switch to that theme for preview and you can change the settings. This is very powerful and saves you a lot of time in the long run!
Apart from your themes, this menu has two main choices: List and Add Block. The List view is the default and lets you see and modify many characteristics of your current blocks, in a fairly intuitive manner. The only “gotcha” is the odd four-pointed arrow at the left of each line, but if you click on that arrow, you can drag the line up or down in the list to change its displayed order or region. Add Block lets you define a block of text or HTML that can be included on any page, essentially giving you an easy way to customize your site even further. RSS feeds, ads from Google or Amazon, and mini slideshows are good examples of the kind of things you can implement quickly using blocks.
Menus: The purpose of this submenu is to allow you to modify and create menu shortcuts to frequently-used items. The first choice here is Navigation. If you select it, you will see very quickly exactly how configurable Drupal is: this screen lets you disable any part of the administration menu itself! That is something you really don’t want to mess with right now, so let’s instead go to the Primary Links screen to better understand how this feature works.
As delivered, this entire screen is blank for you to enter your own items. So let’s say we wanted to create a custom administration menu. By clicking Add Item at the top, you get to a screen that we’ve partially filled in here:
This screenshot shows you how simple the necessary syntax is here. We’re just calling the item Admin and the only path information needed is relative to the site itself, so admin/ is good enough there. You can see by the help text on the screen that you can also use a full URL here, so while this whole exercise is called “Menus”, you can also think of it as “Blogroll” if you’d like to use it that way. By creating similar links to the site’s home page and to admin/build (the Site Building menu), the end result is a screen like this one:
The result of all this, at least using the default Drupal installation, is a little block on the right sidebar looking like this:
And, in the Garland theme, you also get this sort of thing showing in the top right of the banner:
Note the HTML Goodies link. That was created automatically by adding it to the Secondary Links menu, and as you can see, it’s handled and styled slightly differently. You could use Primary Links for internal shortcuts, and then Secondary Links as a blogroll, then go back to the Navigation menu and carefully rename the first one “Shortcuts” and the second one “Blogroll”. Then go back to the Blocks menu and put each one in the page region you prefer. And, now that you know how it all works, you can even go to the Menus menu and add yourself a new menu!