Menus Primary and Secondary Links

There are three default menus that can be configured in Drupal. The navigation menu is the one we have been using up to now and is the standard menu system for traversing all the functionality the site administrator needs. At some point you might want users to have quick access to several main sections of a site, in which case the primary links may be configured to provide this feature. For less important links, generally stuff like About us or Terms of use pages, Drupal provides the secondary...

Input Formats and Filters

It is necessary to stipulate the type of content we will be posting, in any given post. This is done through the use of the Input format setting that is displayed when posting content to the site assuming the user in question has suf cient permissions to post different types of content. In order to control what is and is not allowed, head on over to the Input formats link under Site con guration. This will bring up a list of the currently defined input formats, like this JfiHir tonici dAn 1...

Cron and Scheduled Tasks

In order to keep the site running smoothly, and keep it up-to-date, there are a variety of chores that need to be performed on a regular basis. For example, we saw earlier in the book that the Aggregator module needed to be run on a regular basis so that it can update all its feeds. The Drupal developers are well aware that different modules all have different tasks to perform on a regular basis, so they created cron. php to manage the process. Keeping modules up-to-speed is a case of setting...

Working with CCK

With all the options enabled, we can now go ahead and create a new content type. Actually, it is possible to create new content types without the use of CCK, it's just that the new content types will look pretty much like the standard content types already available, because there are no really interesting elds to add. Head over to Content types under Content management and select the Add content type eld to bring up the following page Content types List g i -. . . I P lt elds Export Import To...

Throttling

With that, it's time to look at another method for keeping Drupal running smoothly, even under heavy loads. Anticipating the need for some sort of congestion control, a good way to deal with surges in traf c or bandwidth usage is to enable the throttling mechanism that ships with Drupal, in the form of the aforementioned Throttle module. Go ahead and enable it in the Modules section of the administration tool under Site building. Once that is done, con gure how the module acts on the site in...

Comment viewing options

I, --------- -----._11 SaveMttmps Flat list - collapsed_raa Date - newest first j 10 tomments per page tj vtur pitFiifc-fl rt a. diii1 -Mfimints and sstim i to activate iOrur chingtj. The remaining sections provide a few options on how users actually create their comments. Once again, you should really take into account the type of site being built. For example, it might seem sensible to force users to preview their comments, but a bunch of regular community users who post very frequently will...

Create Book page

Adding a title for the book and a brief summary of what it is about is really no different from creating any other type of content. The difference comes in setting up where in the book's structure this page is going to be placed. Scroll down the page and open up the section entitled Book outline Selecting lt create a new book gt from the drop-down list indicates that we wish this page to be the start of a new book Drupal dutifully informs us that this will therefore be the top level page in the...

[packt

I hope you'll agree that this page is fairly pleasing to the eye no comments on the photo please For very little work, it is quite easy to achieve a look and layout such as this. What isn't apparent from this page, is that the list of names given here, along with their email links, was provided by a short PHP script that was embedded into the HTML page. Let's get on with the code to start with, we have the following lt div style text-align center gt lt strong gt The MF4Good lt strong gt lt div...

This is not Hebrew J Gdr Outline Translata

Clean's blog Add ne comment n ll lt Notice the Hebrew link at the bottom of this screenshot. This demonstrates how each translation is dutifully targeted to its specific language, and how Drupal links the translations using the language name at the bottom of the screen for easy access by users. At present however, the Hebrew version is being displayed from left to right, which is a problem because those who are fluent in Hebrew would rather have it presented correctly. The reason we are not yet...

Clean URLs

It is important to discuss this particular topic early on because it acts as a cog in the greater machinery of not only your site, but also in how your site interacts with the rest of the Internet. The simplicity of the Clean URLs con figuration page belies its importance As you can see, the choice is simple either enable or disable Clean URLs. Your system should also tell you whether or not it is possible to use clean URLs if you see something like the following screenshot, then you have...

National Geographic News

European Leaders Recognize Independent Kosovo I day 9 hours Lunar Edrpse to Occur in Pnrrie Time Wednesday J day 9 hou old PdtisnLi K h - biLablti Plan U Are ComnwiT, Siudy Says J dsy 9 hours old More This presents us with a nice summary of feeds from each source. So far so good, but what does the More link do Clicking on the More link for the National Geographic News source brings up the following page URL- bm gt ji ew B .pat n sFtl QOraphir.cQ m Building Blocks of Life Detected in Distant...

Drupals Post Installation Status

It's worth noting before we continue further that it is often beneficial to have several development sites in order to play around with different things without mucking up other work. The process outlined so far in this chapter can be repeated as many times as you like to set up as many development sites as you like simply create a new database or, alternatively, provide any new Drupal installation with a table pre x in the Advanced options section and add the Drupal files to the htdocs...

Uninstalling Modules

It's worth mentioning that not all modules are created equal and some make database modifications that can hang around on the system long after the files from the modules folder are erased. In order to keep things neat and tidy, the following few steps should be kept in mind when removing a module from your site. By way of example, let's look at the process of uninstalling CCK 1. Back up your database and module les it's quite possible you realize that you can't live without CCK and want it...

Aggregator

One of the greatest opportunities available to web-based communities is the ability to share information. All that is required is a set of guidelines for how that information is to be presented, and once you have that, the rest is easy. So easy, in fact, that it is now possible to include news and articles of interest on your site from many well known sources with just a few clicks. What makes it so easy to include other people's news, documents, articles, or any other content is a standard...

Dynamic Java Script Features

One of the nice things about working with PHP-based applications like Drupal is that not only are they open source, but they can be combined with pretty much any other technology you can get your hands on. There is a huge online programming community, and many people make their neat little scripts available for the likes of you and me to include into our own sites. Not all are free, but many are, and many more are very cheap so it is always worthwhile looking around at some of the scripting...

The mysqldump Utility

It is probably worthwhile spending some time using this because it provides greater flexibility should you ever need to perform anything out of the ordinary. I will confess, though, that for most database-related tasks phpMyAdmin will perform admirably. In the event that no access to phpMyAdmin is provided on the hosted site, or if it is unavailable for whatever reason, then the following section will come in most handy. To create a backup, type in something like the following at the command...

Export Import

Earlier in this section, we saw that there were additional tabs added to the Content type page under Content management. The first one, Fields, provides a list of all the fields added to the various content types and doesn't warrant much explanation here. The other two, Export and Import provide a powerful facility to effectively copy and paste content types, whole, or piece by piece. For argument's sake, let's assume that the Endangered Species content type is close but not quite the same as...

Theme Anatomy

Some of you might have been wondering what on earth a theme engine is, and how both themes and theme engines relate to a Drupal site. The following two de nitions should clear up a few things Theme A le or set of les that de nes and controls the features of Drupal's web pages ranging from what functionality to include within a page, to how individual page elements will be presented using PHP, HTML, CSS and images. Theme engine Provides PHP-based functionality to create your own unique theme,...

Windows Scheduled Tasks

On the off chance you are using a Windows-based server, or simply wish to enable scheduled tasks on your Windows PC while developing, you can make use of the Scheduled Task wizard. The following instructions, taken from the Drupal site, explain exactly how this is done 1. Go to Start Programs Accessories System Tools Scheduled Tasks. 2. Double-click Add Scheduled Task. 3. The Scheduled Task wizard will appear. Click Next. 4. Select the program to run. Choose your browser from the list for...

JQuery

JQuery, http jquery. com , is a library of JavaScript functions that make developing AJAX and other JavaScript features quick and easy. With the trend for rich, dynamic, and responsive web pages Web 2.0 becoming more and more pervasive, it is important that Drupal keeps up with the times. Accordingly, jQuery has been built into the Drupal core, and you can find the main library files in the misc folder of your installation. Before we can go ahead and start adding dynamic and powerful features,...

Scrolling News Ticker

News tickers can be a nice feature for sites that attempt to provide up-to-date information such as breaking news . If you need to present several bits of information at once, then a dynamic news ticker could be just the thing. With a bit of work, you can even integrate the news ticker with an RSS feed to present breaking news from other sites without having to do any work in creating content yourself. We'll keep it simple and create a scrolling news ticker across the top of each page on the...

Access Rules

So far it should seem like Drupal has things more or less covered when it comes to ensuring that it is possible to control who does what on the site. This is certainly the case, but there are a few more situations that we have not yet discussed, and may well end up affecting the site at some stage. For example, what happens if there is a company that repeatedly spams your forums with advertisements and marketing information Or, what happens if only people from a certain company should have...

Path and Pathauto

By default, Drupal labels pages by number for example, http www.mf4good. org node 2 5. This is not particularly descriptive to either humans or search engines, so the Path module ships with the Drupal core as a way to provide meaningful aliases for content. Providing relevant aliases in other words, a descriptive keyword that occurs in the content can be a real benefit when it comes time for Google to rank your pages. Head over to the Modules section and enable Path. This will create a new URL...

User settings

User feQistration -settings Public mi'ilrfltiupiS Q Only iiCe adnnihrEtrittiri n cra e new O Visitors can rreaie accounts and no administrator apprayj is required WlCOrjtan cr atft ,Jtit3UCS but JdminiotJiTor jupriival rOQuirOd 0 RfllJulr'e e-IT13.il feiMlifltiflr1 hflil i iiiC0f in account K Uiu L'U i ut rc u-ll ba ra vinJ r gt LNb.i 4-mill Ad Jin 11 .'- p L I j' in ihH ind I in jiii iid W'ih tt unch k d lt -jr 'r vlll In .mm Ji uc en rtgiritiiUljg, klld rniV i l thair fi n p JMir jdl during...

Introduction to DrupaT

Up until quite recently, the most important thing a newcomer to the Web could do in order to prepare for building a website was to buy a book on how to learn programming in any one of the major web-centric languages like PHP or Perl. The not inconsiderable task of learning the niceties of the chosen language to a respectable degree would then consume a fair chunk of time and patience. Once our hapless newcomer had sufficient mastery of the fundamentals, applying that knowledge to program...