Views 1

If you ask anyone who has used Drupal for a while what the killer module is, the answer will likely be Views, Panels, or the Content Construction Kit CCK . Views is usually mentioned first, and it's the module that many users say they can't live without. What does the Views module do that is so special Simply stated, Views provides an easy-to-use tool for selecting and displaying lists of content on your website. Examples of how you might use Views include Displaying the most recent news...

How to Download Install and Configure a Module

The first step in installing a module is finding the right module to use. As described earlier, there are thousands of modules to pick from finding the right one is often the biggest challenge. For demonstration purposes, let's pick one of the most popular, powerful, and useful modules the Views module. A new feature of Drupal 7 is an administrator's page, which allows you to download and install a module by simply entering the URL of the install file and clicking a button. Drupal handles the...

Update Notifications

Check for updates automatically If checked, this feature looks for updates to Drupal core and any contributed modules you have installed and highlights cases where a new version or a security patch has been released. It's a good idea to check this, as it makes the task of tracking updates to modules much easier than having to manually check each module's status. Receive e-mail notifications If checked, this directs Drupal to send an e-mail to the administrator when new versions of modules are...

Creating a Panel Page

When creating a panel page, you need to decide what content is going to go on the page, as well as the layout for the page. You can use Figure 12-2 to figure out whether an off-the-shelf layout exists that meets your needs. If one of the eight basic layouts doesn't work, you can always create a custom layout using the flexible option. For demonstration purposes, we're going to assume that we want to divide the content region into three rows, with the first row having a single column, the second...

Using the Flexible Layout Option

There may be situations where one of the eight pre-defined layouts available in the Panels module do not meet the layout needs of a particular page. In these situations, you can use the flexible layout option, which provides the ability to create virtually any layout you can imagine. To create a new flexible layout page, follow the steps outlined in the previous section for creating a new panel page click on the Structure link in the top menu, followed by Panels on the Structure link, and the...

Formatting the Output of a Custom Content Type

There will be times when the visual representation of your new content type doesn't fit with how you would like the content created with your new content type to be rendered on the screen. Adjusting the order and positioning of the labels in relation to the field can be accomplished by clicking on the Manage layout link for the desired content type. To access this feature, click on the Structure link at the top of the page and then click on the Content type link on the Structure page. To access...

Assigning a Taxonomy Vocabulary to a Content Type

Providing content authors with the ability to assign one of the terms to a new piece of content requires that a site administrator updates the all of the content types to include a reference to the vocabulary that we wish to link to content on our site. The first step is to identify all the content types that you want to associate with the new vocabulary. You may decide that all content types will use the vocabulary to categories the content created on your site, or you may decide the...

Setting Up Your First Forum

To enable the Forums module, click on the Modules link in the top menu and scroll down the page until you see the Forum module. Check the box associated with the module and click the Save configuration button at the bottom of the page. Drupal will install the Forums module. The next step in the process is to set permissions for forums. Here are the permissions that you can Create new forum topic content Edit own forum topic content Edit any forum topic content Delete own forum topic content...

Configuring Blocks

You can select various configuration setting for blocks on the Blocks Administration page. The configuration options include overriding the title of the block and setting the visibility of the block based on several optional parameters. As an example of how you might use these features in the future, let's change the Who's online block so that it only appears on the homepage of your site, and only when the visitor is a user who has logged into the system with a user ID and password. To make...

Adding a Menu Item for an External Page

You can add links to external sites by adding a menu item. To do so, click on the Structure menu item at the top of the page. On the Structure page, click on the Menu link. On the Menu page, click on the Add item link for the Main menu. You should now see the Add menu item form see Figure 5-4 . Enter a title in this example, I used Apress as the menu title , the path, which is the full URL to the external page to which we want to link in the example I used www.apress.com , ensure that the...

Radio Buttons

Radio buttons are useful when you want to present the author with a list of values from which they can select only a single item check boxes are used when you want the author to have the ability to select one or more values . We will expand our Event content type to include the ability to select the type of seating that will be available at the event either reserved seating or general admission. To start the process, click on the Structure link at the top of the page, followed by the Content...

Creating a Horizontal Menu

The next requirement for our new theme is to create a horizontal menu that appears below the header. The first step in this process is to add a new region to the theme. To add a new region, edit the genesis_mytheme.info file and add the following line to the end of the list of regions contained within that file regions main_menu_links Main Menu Links This code instructs Drupal to include a new region with an internal name of main_menu_links to the list of available regions. The value to the...

The Basic Page and Article Content Types

When you install Drupal 7 you automatically receive two content types that have been defined by the team who maintains Drupal core the Basic page and Article. If you author a piece of content using the Basic page content type you will see that it provides two basic fields a title and a body. An author using the Basic page content type simply enters a title a required field as indicated by the red asterisk and the text of their content in the body field. The body field is flexible and can...

Items Per Page

If you decide to use a pager for your view, you can set the number of items that will appear on each page by clicking on the small gear icon to the right of the Use pager option. Clicking on the gear reveals a form where you can set the number of items that will be displayed per page, the offset think of the offset as the starting item for your view for example, if you want to skip the first 10 items and start at number 11, you would enter 10 in the offset field , the pager ID in nearly every...

ReArranging Blocks

It is likely that, at some point in time, you're going to want to re-order how blocks appear on a page. In the previous example, we may want to have the Who's new block appear above the Who's online block. To re-order the blocks, navigate to the Blocks page by clicking on the Structure link at the top of the page. On the Structure page, click on the Blocks link. Once on the Blocks page, simply click and hold the plus sign next to the block that you want to move, and drag that block to the...

Use Pager

For lists that will contain dozens or hundreds of items, you can limit the number that appear on a page usually to 10 or so and use a pager at the bottom of the page instead. A pager looks like this lt lt previous 1,2,3,4,5,6,7 next gt gt . Visitors use the pager to navigate through all of the items. Views automatically creates and displays the appropriate pager based on the number of items that are in the complete list. By default, the Views module renders lists using a pager with 10 items per...

Configuring the Genesis Theme

If you haven't done so already, follow the instructions in Chapter 6 and install the Genesis theme www.drupal.org project genesis . You'll notice that the installation process creates two versions of it Genesis base and Genesis subtheme. A majority of Drupal starter themes use subthemes as the mechanism for creating a new theme based on the foundation provided by the base theme. This allows you to create one or several new themes using the same underlying foundation without having to start from...

Finding the List of Available Blocks

To find the list of blocks that are available for you to use on your new web site, click on the Structure link at the top of the page. This takes you to the Structure page. On the Structure page, click on the Blocks link to reveal the Blocks page, which lists all the defined blocks on your system, including those that are already assigned to regions and those that are not assigned to a region. See Figure 7-2. 4 P we red by Drupal 4t Who's online Management tf- User iogin Navigation Search form'...

Approving Requests for User Accounts

Drupal lets you, the site administrator, determine how user accounts are created on your website. You can Allow site visitors to create their own accounts without approval by a site administrator. Allow site visitors to request an account, but require that a site administrator approve it before allowing the visitor to use the account. Restrict account creation to only the site administrator. The approach you use is completely dependent on whether you allow visitors to have their own accounts....

Installing Themes

In this chapter I will explain the process of changing the overall look and feel of your site by installing a new theme. I will walk you through the process of selecting, downloading, and enabling your selected theme. You've added some neat things to your site in previous chapters, and we've seen some exciting features of Drupal but this chapter will have you going wow The visual layout and presentation of your new Drupal site is defined through a Drupal component called a theme. A theme...

Sort Criteria

One of the power features of Views is the ability to sort the output of our view before it is rendered on the screen. You can sort on none, one, or several fields that are associated with your content type. For our example, we want to sort on the list of upcoming events by the title, in ascending order. To set the sort criteria, click on the plus sign in the heading for sort criteria. You'll see the form shown in Figure 11-11. Node Promoted to front page Whether or not the rode 5 promoted to...

Live Preview

You may have noticed a feature at the bottom of the Views configuration page called Live Preview. This allows you to quickly test your view to see if it is displaying the right values in the right order. You can click on the Preview button at any step in the process to see how the view will look on a page. See Figure 11-15. Separate arguments with a as though they were a URL path. Chirle Dldcens classic pi jy cones to the Paramount.

Status Report

A general health report for your site can be accessed on the list of Reports page by clicking on the Status report link. Clicking this link reveals a page that highlights key areas of your Drupal installation that are of relatively high importance. Items that are checked when you run this report include whether critical configuration files are protected from unauthorized changes and whether the database is up to date. In Drupal 7, with the revised approach for installing modules, it's unlikely...

Electronic Transition Portfolio

Drtgow, EiSiwijfll -SkiiiU optisw-oL Who am, I avu where, etui I JOL U Drtgow, EiSiwijfll -SkiiiU optisw-oL The Electronic Transition Portfolio is a tool that allows High School students prepare for the transitiani to higher education or the workforce. If you do not have an account for the system please check with your teacher. Figure 6-2. A creative non-traditional Drupal theme