|
|
Want to know more about Packt's Article Network? Interested in contributing your article ideas? Please visit our FAQ for more information. See More BROWSE
All Titles WordPress Web Services SOA BPEL Web Graphics & Video Web Development RAW Portugues, Espanol, Italiano, French PHP/MySQL Oracle Open Source Networking & Telephony Moodle Microsoft & .NET Linux Servers jQuery Joomla! JBoss Java e-Learning e-Commerce Dynamics Drupal CRM Cookbook Content Management Beginner Guides Architecture and Analysis AJAX Future Titles Recently Published Titles The example project in this article by Timi Ogunjobi is based on a fictitious web site development brief, and it illustrates a practical way of applying Drupal to develop a News Aggregation site called Weird Hap'nins. Bad news is always good news for the press. This is why Vaughan Pyre has decided to take advantage of this fact and create a web site that will aggregate bad news and weird happenings from all over the world. The content of the site will be entirely derived from Really Simple Syndication (RSS) feeds from several sources (each feed being automatically fetched and its items displayed on the web site). See More |
Building a Personal Site Using Drupal 6
Isaac wants his web site to have the following features:
ThemeSmart 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 siteOkay, 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:
ModulesIn order to create the desired web site, we will be using some essential Drupal modules. Optional Core modulesThe following optional Core modules will be required:
Contributed modulesThe following contributed modules will also be used:
Basic contentSmart'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 typeBy 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:
Categorize contentWe 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:
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 formNow, 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. ImagesDownload 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 pageThe 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.
Tips and traps
Drupal 6 Site Blueprints
Create Blog postsBlog posts will be created in the same way as the other Content types. Click on the Create content link on the admin menu and select Blog entry. This will give you a form similar to the one that we have used to create the About Me page. Smart will be able to type in his blog posts and save them. This is so very easy!
Create a PublicationPublications will also be created from the Publication Content type.
Create a Contact formHaving enabled the Contact module, we will now configure this to send messages to Smart at his email address iamsmart@drupelburg.edu.
Display contentNow comes the fun part of nicely displaying the content for viewing. Create quick menus with the Taxonomy Menu moduleNow that we have learned much of what is required to post content into Smart's web site, let's take a look at how we may view the content that we have put in. Again, there are several ways to do this. My favorite "quick and easy way" is to use a module known as the Taxonomy Menu. What this essentially does is permits you to view the content on your site just by clicking on a menu link that corresponds to the title of a vocabulary term. Select the vocabularies that you want to include in your menu, and save the configuration. You will now see the links to items related to each vocabulary under the Navigation menu in the sidebar.
MenusWe now have all of our pages as Smart would want them, but the navigation could still be improved. What we are going to do next is to arrange all of the menu items so that they are easily accessible. To do this, we will have to visit the Menus link on the Administer page, which will bring us to the page shown in the following screenshot:
What we intend to do is to move all of the menu links of the site content pages, as well as the Contact form page under the Primary links menu. At the moment, most of them are still under Navigation. So let us visit the Navigation menu page.
When you are finally returned to the Primary links page, you have the opportunity to rearrange all of the menu items as you wish by dragging them to the desired positions. Latest blog postsSmart wants a list of his latest blog posts to be shown on the front page. Doing this is a lot easier than you might think. Let's visit the Blocks page, by going to the Blocks link on the Administer page. We will see that a block already exists for Recent blog posts. Drag it to a position under Content. However, this will make the latest blog posts to show on all of the pages, despite the fact that Smart only wants them on the front page. So we will need to configure this block to show only on the first page. Click on the configure operation in front of the block, and for the Page specific visibility settings, enter node.
While we are on the Blocks page, let's also drag the Primary links block to the Left sidebar (where we want it in our theme). The Block title of the block can be set to <none> to remove the default Primary links title. As IM Smart wouldn't allow anyone else to log in to his web site we could also disable the login form, by removing by setting the Region of the User login block to <none>, and then click on the Save button, at the bottom of the page, to finish. PermissionsA couple of details still need to be sorted out. We have created the content, but as it presently is, not the entire site is visible to everyone, especially the Contact form. We must set these permissions via the Permissions link on the Administer page. Make the access site-wide contact form permission accessible to all roles. Now, let us visit the front page to see what we have so far.
Finishing upSmart has chosen the AD The Morning After theme to make his site more interesting. So we will now upload the theme and enable it. The theme, once applied, confirms that all of the work required for I. M. Smart's site is finally done.
SummaryIn this article, you have learned how to:
In real life, you may have more Content types and more content pages that are linked to the menu, such as the "About Me" page and a larger number of content categories, but the procedure basically remains the same. Drupal 6 Site Blueprints
About the AuthorTimi Ogunjobi Timi Ogunjobi is a Technical Writer, Web Developer and Open Source Evangelist. Trained as an engineer, Timi has been developing web applications in several frameworks for more than 7 years and has also been writing for more than a decade on a wide variety of topics. Timi is the principal of Websesame – http://www.websesame.com – a software development and Technical writing company. Timi balances his time between programming, reviewing, writing, and contributing to interesting web-based and community projects. When he isn't working (which isn't that often) he enjoys playing jazz guitar and getting involved in outdoor activities principally cricket, golf, and swimming. Books from Packt
|
TOP TITLES ![]()
|
| ||||||||