|
|
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 personal site. Isaac Meredith Smart is a professor of Sociology at Drupelburg University. His need is quite simple, and all he intends to do is to build a personal web site that will provide some shameless publicity to promote him professionally. The objective is to give his students, as well as the entire academic community, as much information about himself as is decently permitted. See More |
Building a News Aggregating Site Using Drupal 6
Weird Hap'nins requirements will be the need to:
ThemeThe theme chosen is "Strange Little Town", which is a contributed theme that fits the description of this unique web site.
Build Weird Hap'ninsVaughan Pyre is a very ambitious webpreneur. What he really hopes for is a web site that is completely self-maintaining, and on which he can place some Google AdSense blocks. Clicks from the visitors to his site will ensure that he makes lots of money. For this, he needs a site where the content updates regularly with fresh content so that visitors will keep coming back to click on some more Google ads. Vaughan's ultimate objective is to create several of these web sites. ModulesThis is, surprisingly, a very simple site to build, and much of the requirements can be achieved by using the Core Aggregator module. Indeed, were it not for the fact that Vaughan needs the content to automatically update, we needn't use any module other than the Aggregator module. Optional Core modulesWe will be using the following Core modules, which can be enabled via the Modules page:
Contributed modulesWe will also be using the following contributed modules from Drupal.org. Install, and enable them via the Modules page:
Configure the Poormanscron moduleFirst we need to enable the Poormanscron module, so that the incoming feeds will be able to self-refresh. From the Administer page, we will access the Poormanscron configuration page, mainly to set the time interval between runs of cron to update feed items, as shown in the following screenshot:
In this case, we have left the Time intervals at the default value of 60 minutes. Configure the Aggregator moduleThe Aggregator module should be configured to define the feed sources, how often they will be polled, and how they're categorized. For this, if we select the Feed aggregator link on the Administer page, then we should arrive at the following page:
On the Settings page, we will define some more requirements, as follows:
Basic contentThe site is built around the Aggregator module, and no other Content type will need to be created. Vaughan has decided to initially use three feeds obtained from www.newsfeedmaker.com, as follows:
It is from these feeds that we will create the necessary content. Tips and traps Add feedsOn the Add feeds page, which is under the Feed aggregator configuration page, we finally get to define our feeds, and how often we want them to be polled.
We want our Bad News feed to be polled every hour, so we have configured it this way. The same procedure is followed to create the feeds for Crime and Paranormal. Drupal 6 Site Blueprints
Display the feedsIt is necessary to first start the feeds so that you can be sure that they work. Therefore, if we go to the List tab on the Feed aggregator page and click on the update items link on the righthand side of each listed feed, then we will see that the site polls items from the feeds that we have configured.
Clicking on the Title of the feed on this page will show a page view of the resulting feed. For example, the Bad News page gives us the following view:
Newsfeed blocksVaughan wants to have blocks containing the latest items from the incoming feeds placed on the front page to encourage visitors to read more and to visit more often. If we visit the Blocks page, then we will see that blocks for Bad News feed latest items, Crime feed latest items, and Paranormal feed latest items have been conveniently created by the Aggregator module. We may now assign these blocks to the Bottom Content region, and configure the blocks to only show on the front page. Create the front page postVaughan needs only one post on the front page, and wants this to be placed at the top of the page, to describe the web site. This post will be created from the Page Content type. In order to do this, click on the Create content link on the lefthand side of the screen, and select the Page link. You will see a form similar to the one shown in the following screenshot:
In this form, we enter the introductory text for the site. At the bottom of the page, in the Publishing option panel, we will promote it to the front page and make it Sticky at top of list. This is necessary just in case Vaughan decides to add new items to the front page, which may effectively displace the site description post that he always wants to be at the top. Tips and traps MenusNow let's tidy up our site by creating a menu system that is more intuitive. For simplicity, we will be putting all of our feeds page views menu under a new Feeds menu, to separate it from our user's menu. In order to do this, go to the Menu link on the Administer page.
These URLs may be obtained from the display in the browser without the preceding string (http://.../?q=). Return to the Menus link on the Administer page and select Feeds. At the top of the page that comes up, select the Add item tab. This will take us to a page (shown in the following screenshot) where we can define the items in our menu.
We will also see from the Blocks link on the Administer page that a new block has been created for Feeds, and we will assign this to the Right sidebar, which is where we want it. Finishing upWe can now enable our new theme, Strange Little Town, on the Themes page, which will give us a new front page, as shown in the following screenshot:
SummaryIn this article, you have learned how to:
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 ![]()
|
| ||||||||