Isaac wants his web site to have the following features:
- An “About me” page—showing his personal profile and interests
- A page that will list all of his publications
- A Blog to tell the world what he is currently doing, with a list of the latest blog posts displayed on the front page
- A Contact form that site visitors can use to send an email to I.M. Smart
Smart has chosen the “AD The Morning After” theme (which is a contribution to the Drupal project) because he loves the design. The front page will feature a teaser for Smart’s profile at the top of the content area, and a list of his most recent blog posts in a block at the bottom of the front page. The final layout of Smart’s web site can be seen in the following screenshot:
Build I.M. Smart’s site
Okay, this guy Smart doesn’t appear particularly likeable does he, and isn’t this quite typical of university professors? But let’s put our prejudices aside for a couple of hours and get his work done for him. The major tasks in building the web site for Isaac Smart will be:
- To create a new Content type called “Publication”, under which he can list all of his work
- To be able to allocate terms to describe each added work
- To be able to display a Page view of the list of publications
- To be able to create a Block view of the list of his daily blog posts
- To create a simple Contact form
In order to create the desired web site, we will be using some essential Drupal modules.
Optional Core modules
The following optional Core modules will be required:
- Blog—will enable him create his blog posts
- Taxonomy—will enable him to classify his blog posts
- Comment—will allow all visitors to his web site to comment on, and to discuss his blog posts and publications
- Contact—will allow site visitors to send him personal messages
- Upload—will allow the upload of files into content
The following contributed modules will also be used:
- Taxonomy Menu—will allow taxonomy vocabularies to be transformed into menus easily
- IMCE—will give the ability to upload and manage files and images
- Image—will allow the inclusion of images in content
Smart’s site is quite basic. The About Me page can be safely created from the Story Content type, and that is what we are going to do. However, to add an element of danger to the project, we will be including a new Content type for his publications, and we will call it just that—”Publication”.
Create a new Content type
By navigating to the Administer page of the site and then to the Content management section, we will find the Content types link.
If we access this page, then we will see the various Content types listed there. Here, we need to create a new Content type for “Publication”.
To create the “Publication” Content type:
- Click on the Add content type link at the top of the page. You will then be presented with a form.
- Add the Content type description and the general rules for the adding and display of content for this new Content type, in the places where they need to be in the form. Here are some guidelines:
- In the Identification fields, add the Name and the Description of the Content type (in this case “Publication”).
- In the Submission form settings, you can choose the titles that you want to give the fields. By default, you are presented with Title (for the title of the submission), Body (for the main story), and also fields specifying the minimum length of the article before it can be accepted for submission, as well as another place where you can describe submission guidelines for this Content type. Leave this at the system default setting.
- In the Workflow setting we need to determine the default options:
- Do you want the article to be immediately published and available for use on the site, immediately after submission? If so, select the Published checkbox.
- Do you want to promote the article to the front page? If so, select the Promoted to front page checkbox.
- Do you want the article to remain at the top of the list of contents on the site? If so, select the Sticky at top of list checkbox.
- In the Comments settings panel, indicate whether you want to allow comments to be made on articles of this Content type or not, and if you do, how these comments will be handled. As previously mentioned, Smart wants to allow comments to be added to his publications by site visitors.
We first need to establish how the content is going to be organized for use on the site. This is quite easy because we have created only one new Content type, named Publication, that will have taxonomy terms—Books and Papers—attached to it. By doing this, we will have set the ground rules for how content will be created and displayed on the site.
Categories or terms may be used to further classify items that, even though they fall under the same Content type, need to be grouped with others with which they bear a close similarity. In this case, Smart’s Publication list includes Books and Papers, which, even though they are both publications, would do well if grouped separately. So we must now create the new categories and establish relationships between these new categories and the new Content type.
Go to the Taxonomy link under the Content management section on the Administer page, and click on it to get to the Taxonomy page. If you have started a new site, then at the foot of this page, you will see a notice that there is no vocabulary available for your new categories. The vocabulary is a term by which a collection of categories (or terms) can be collectively described. In this case, let us create a vocabulary that we will call Publications Type. We will do this by clicking on the Add vocabulary link at the top of the page. This is what we will be entering into the form for this new vocabulary:
- In the Identification panel, let us enter the Vocabulary name, and a Description, as well as any Help text that will guide Smart when he comes across this vocabulary. For Publication, we have used Publications Type as the Vocabulary name. For the Description, we have entered The type of publication. Is it book or paper? For the Help text, we will be instructing Smart to Select appropriate publication.
- We need to associate this vocabulary with a Content type. We have created it specifically for Publication, so we will naturally select the Publication checkbox.
- For the Settings, we declare that the selection of a term from this vocabulary is Required, and that Smart must choose a term from the supplied list. Moreover, because a Publication can be either a Book or a Paper but never both, a posted content may not have more than one term associated with it. Therefore, leave all of the other checkboxes with the system default settings.
The completed vocabulary page is shown in the following screenshot:
On returning to the Taxonomy page, we can see the new vocabulary that we have just created is listed. Now we need to add the terms for the vocabulary. We do this by clicking on the add terms link and completing the form that we will be presented with. At this stage, forget about the Advanced Options link at the bottom, because we only have a single level of terms.
If you click on the list terms link on the vocabulary, then you will be presented with a list of the terms that you have created, in the order that these terms will be presented to Smart. If you don’t like this order, then just drag the ones you want to change to the location that you want.
Test the submission form
Now, let us test our content submission form and see how it works. In order to do this, you click on the Create content link (on the lefthand side of your page), and select Publication. You will then get a form, as shown in the following screenshot:
Using this form, Smart will be able to post the details of his many publications to his web site. However, he doesn’t know a thing about HTML (which proves that he isn’t so great after all) and will definitely have problems while uploading images into his posts. So, we will give him an easy way to do this.
Download the IMCE and Image modules. Install and enable them. It is also essential that you have the Upload module enabled. The TinyMCE editor (even though it is not essential) will permit Smart to edit his pages without knowing any HTML. Download the editor, if this feature is required.
Having done this, return to Administer | Content management | Content types, and select the Publication Content type. At the bottom of the page, you will see a new panel for Image Attach settings. Enable Attach images, and now the Publication Content type will be ready to incorporate images. To confirm this, go to the Create content link for the Content type. Near the bottom of the page you will find the Attached images panel, as shown in the following screenshot, where you can upload images for your content. Do the same for the Blog entry, Story, and Page Content types.
If you have configured your TinyMCE editor correctly, then you can similarly post images into the Body of your article by using the image upload function in TinyMCE.
We will also ensure that the Attach images functionality has been enabled in all of the other Content types. Then, in the Workflow settings for each Content type, deselect the Promoted to front page checkbox, or else you will end up with a very unruly front page display.
Create the About Me page
The About Me page, as we have decided, should really be quite straightforward and will be created from the Story Content type, which is recommended for content that is static.
- From the admin menu, click on the Create content link, and then select Story. This will give you a form, which is similar to the following screenshot:
- The handy WYSIWYG (What You See Is What You Get) editor, which is an emulation of desktop software like MS Word or Open Doc (with which most people will probably be accustomed), will make it easy for Smart to create his personal information page, and format it to his satisfaction.
- Because Smart wants this to feature on the front page, we will just promote the About Me page to the front page before saving it. The Menu settings field is optional, and it is only used if you want to add the item to the menu system. We will add the About Me page to the <Primary links>.
Tips and traps
We have used this approach because Smart is the only person having a personal profile on this web site. Otherwise, it will not be adequate, and we may have to call up some other modules, especially the CCK module, which will enable us to create new form fields to make submissions more intuitive (for example, to present defined fields for name, education, interests, and so on).