HandsOn Creating Roles

Earlier, we talked about Drupal's access control system, and how it's composed of users, roles, and permissions that map to who is going to use the site and what they're going to want to do on it. Let's spend a moment brainstorming about Mom and Pop, Inc.'s needs in this area. This site will have four types of users Passing visitors, who will basically only be able to read and search content, comment on news items once their content has been approved, and send mail with the contact form. This...

Navigation

Hand-in-hand with creating content is being able to find it on the site. Drupal provides a built-in module called Menu for this purpose. Menus hold the navigation links to various web pages on a Drupal site. Drupal comes with three default menus The main system menu. In practice, this menu is the default dumping ground of links offered by modules, including administrative tasks. Primary links An empty menu provided for custom navigation needs, typically displayed very prominently in the site's...

Contents of This Book

Beyond the initial chapters that set the stage, this book is organized as a series of recipes, each of which consists of the following structure The introduction gives an overview of what modules are covered, as well as the overall goal of the chapter. Case study The case study describes the needs of a fictitious client who requires a website that can be a wiki, or have product reviews, or an image gallery. We describe some background information about the client, and go into more detail about...

Site Maintenance Mode

If you navigate to the AdministersSite configurations-Site maintenance (admin settings site-maintenance) page, pictured in Figure A-11, you can set the site into offline mode prior to the upgrade taking place. This mode is useful, as sometimes updates can temporarily cause errors before the entire process is completed. Offline mode makes the site inaccessible to regular users while still allowing administrators to work on the site. You don't want users creating content while you are updating...

Spotlight Internationalization

So far we've got a nice start with getting our site translated, but everything is not quite smooth yet. We have translations for some of our content and menu items, but they are all appearing at the same time. There are multiple posts on the front page, and all the language menu items are showing regardless of which language we are viewing the site in. You will also see some stray text still in English. For example, under the Create content menu item, the content type descriptions are...

Make a Copy of the Theme

The first step in customizing a theme is to make a copy of it and place it into the appropriate location in the sites directory. Think of the sites directory as the stuff that makes your site yours. All of your customizations, installed modules, and themes should go into this directory. For most sites, this will mean placing themes into sites all themes. Drupal will discover themes within subdirectories, so feel free to organize this however you like. 1. Ensure that sites all themes exists and...

Image Galleries

Although being able to upload photos is a good start for the Robinson family, Fritz knows that every photo-sharing site needs something like galleries, where users can group photos. In our photo gallery, Fritz identified that a gallery is no more than a grouping of photos under a single name or category. This concept maps directly to o Web page addresses and e-mail addresses turn into links automatically, o Allowed HTML tags < a> < err> strong < crts> < code> - < o> <...

Configure Actions

Go to AdministersSite configurationsActions admin settings actions and click the select list under Make a new advanced action available, as shown earlier in Figure 6-2. You will see a number of actions we can set up. Select the Send email action and click the Create button. 2. Enter the information shown in Table 6-2 into your form. Table 6-2. Settings for the editor notification email action Table 6-2. Settings for the editor notification email action username submitted a new node_type...

Value

To review the full article and publish or delete it, visit node_url. It's important to note that certain special placeholders are being used in our messages. Whenever the action is triggered, user-name, title, and node_url are all automatically replaced with information from the node that was submitted. These are similar to the tokens used in Token module in the previous chapter. You can see the full list of available placeholders in the help text under the Message text area. 3. Click the Save...

Spotlight Flag Module

The Flag module formerly known as Views Bookmark is an incredibly flexible module that allows you to create relationships between users and content on your site. After creating a flag, an item can be marked with the flag a few different ways, including links displayed below content, as shown in Figure 9-10, or checkboxes displayed on the edit form, as shown in Figure 9-11. Morbi nor erat rion ipsum pbaretra tempus Donee orci, Proin in ante, Pellentesque sit amet pur us. Cras egestas diam sed...

Add the Date Field

With all our required modules enabled and set up, we can now customize the Event content type we created earlier by adding dates. Note that as we do this, we will only add a single CCK field to handle both the event's start and end times 1. Go to AdministersContent managements-Content types admin content types and click the manage fields link for the Event content type admin content node-type event fields . Complete the New field form with the values in Table 9-6. Table 9-6. Settings for adding...

Managing Site Navigation

Great We now have a couple pages on the site and our navigation menu is starting to come together. However, there's something a little funny going on our menu items in the top righthand corner are displayed in alphabetical order, which puts About Us before Home. It would make a lot more sense for Home to come first, so let's fix that by reordering the items listed in the menu. 1. Go to Administer Site buildings-Menus admin build menu and click Primary links 2. Using the handles on the left...

Configuring Product Attributes

For the Sweet Tees online store, customers need to be able to select the T-shirt size that they wish to order, as well as the colors of their shirts and stickers. To implement this, we will make use of Ubercart's product attributes feature. Figure 10-17 shows an example of the Size attribute. Home Administer - Store administration - Attributes Name Default cost Default price Default weight Order Operations Products o Attributes o Reports Figure 10-17. The Size attribute and its options 1. Go to...

Event Management

Managing online calendars and event registration can present a huge challenge. Without a dynamic system, the task is nearly impossible. Generating the HTML required to display a calendar and all the various presentation options day, week, month views, and so on is unreasonable and worse, because the events are time-sensitive, remembering to update next or upcoming event lists can be onerous. Nothing looks worse than having last week's meeting listed first on your Upcoming Events page. Even with...

Using a Preset

After setting up presets in the ImageCache administration area, you need to tell Drupal where these presets should be used. ImageField and FileField provide options to display the images full-size or in a generic file list. After configuring ImageCache presets, additional options for displaying images become available. The typical display of images is configured using CCK formatters, as shown in Figure 7-15. For every ImageCache preset setup on your site, ImageCache adds four new formatters...

Wiki Functionality

There is a long list of modules to help us satisfy the requirements for this site. When looking for wiki solutions, the obvious place to start looking would be wiki modules. There are three modules with wiki in their names, Wiki http drupal.org project wiki , Liquid Wiki http drupal.org project liquid , and Wikitools http drupal.org project wikitools . Wiki was developed as a means to centralize the various wiki solutions in Drupal in a single package, but has been abandoned since 2006 and...

Attendance Tracking

The Signup module http drupal.org project signup is designed specifically for the purpose of tracking event attendance, and has some nice features such as the ability to email reminders to attendees prior to an event. However, this module was unavailable for Drupal 6 and was undergoing development at the time of this writing. Instead, we will use this opportunity to highlight a helpful general-purpose module called Flag http drupal.org project flag . Flag known as Views Bookmark in Drupal 5...

Aurora Book Club

Completed event calendar, with iCal link the Date field s section, click on the Date Date link and under Date field s , uncheck Node Updated date and check Content Time field_time value instead. Then click Update. 5. For the Fields section, add the Content Time field_time_value field, then make the changes noted in Table 9-14 and click Update. This selection will show our event's date, rather than the node's last updated date, and will remove the word Title from the event name that...