Creating a Drupal node template for Flash

Moving back to Drupal, our next task is to take our compiled Recipe Flash application and integrate it into our Drupal system. We will start out by doing the same thing we did in the previous chapters, and add our Flash application to our Drupal web site using the FlashNode module. We can do this by simply going to Create Content Flash, and then selecting our new SWF file where it asks for the Flash file. We can then click on the Save button to submit this Flash application to our Drupal...

Adding our custom media player to Drupal

The first step we will need to take is to change our nodeid variable back to the FlashVars format so that we can compile our new media player for Drupal. var baseURL String http localhost drupal6 var gateway String baseURL + services amfphp var sessionId String var nodeId Number root.loaderInfo.parameters.node After we run our media player with these changes (which compiles the SWF file), we can follow the steps from Chapter 4 and upload our new media player by navigating to Create Content...

Info

When we are finished walking through the steps above for the Instructions field, we should then have the following fields within our Recipe content type We should now have a Recipe content type that has all the necessary elements for any user to accurately submit a new recipe to our web site. So, let's go ahead and test this out by going to Create Content Recipe. Although, you will see the Instructions and Ingredients fields in the recipe form, you will most likely also notice that the Body...

Installing the Image Field module

In order to successfully install the ImageField module, we will also need to install the modules that the ImageField module is dependent on. Because of this, we will first need to install a total of three modules in order to use the ImageField module. These modules are as follows FileField ImageField Once we place these three modules in our site's modules folder, we can navigate to Administer Modules, where we should see the following Defines a file field type, mt . Depends Oft Content enabled...

Image Field for CCK

As far as I am concerned, CCK Content Construction Kit offers the most flexible method for adding custom content to our Drupal web site. Although there are dedicated modules that give us the ability to add custom content, I have found that it is easier and more consistent to take a single approach to create custom content through the use of CCK, and the ImageField module uses the power of CCK to add images to any content type in our system. I believe this flexibility is what gives ImageField an...

Using the Content Template module Contemplate

The Content Template module Contemplate for short is a wonderful module that will allow us to create a template for any content type in our system. A template is simply a way to tell the system how to display each content type when it is viewed by each visitor, and we can use this to tell Drupal to show our new Recipe Flash application when anyone views a Recipe node. To begin, we will first need to download and install this module by going to http www.drupal.org project contemplate. Once we...

Installing a media player

There are several media players available to show video and audio content on our web site. Although each one of these players has their differences, all of them are fundamentally the same in how they play media on the site they are loaded. Following are the most popular media players that can be used with the jQuery Media module to show videos Dash Media Player JW FLV Player jw-flv-player Flow Player http www.flowplayer.org All of these players are great, so I suggest you read up on all of them...

The Drupal Service class

In all the previous chapters we interfaced with Drupal using the simple Netconnection call method. With each of these calls to our Drupal system, the API key was not required, and consequently, it was not necessary to build a separate class for interacting with our Drupal web site from a remote location. However, now, we have a special need to make certain service calls that require an added security measure, which should be encapsulated within its own class. Because of this, we will use this...

Installing the getID library

The getID3 library is a very useful PHP library that will automatically extract audio information called ID3 from any given audio track. We can install this useful utility by going to which is the getID3 library URL at SourceForge.net. Once we have done this, we should see the following We can download this library by clicking on the Download link on the first row, which is the main release. This will then take us to a new page, where we can download the ZIP package for the latest release. We...

Adding arguments to the service call

Our next task will be to determine which methods require an API key and which do not. This can be done using a simple function within our DrupalService class that will let us know if the API key is required given the service command. Although there are several functions that require an API key, we will only include the ones that we will use in our application. This function will look as follows Determines if we should use an API Key. private function usesKey command String Boolean switch...