Country settings

Selecting the Country settings link will lead to the expected Country settings page. Select the Import countries link to give Ubercart the details of the countries that your cart will deal with. In this case, and only for the purpose of illustration, we have selected United Kingdom Canada and the United States have been imported by default. Country settings overview Country formats Country file united_kingdom_826_l.cif imported. To import new country data, select it in the list and click the...

Installing the ImageField 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...

The Seq Configuration File

On startup, seq24 reads in preferences from the file .seq24rc a hidden file in your home directory . Close seq24 first, and you can then modify this human-readable file in a terminal with a text editor for example, using the nano editor By default, seq24 manages MIDI connections itself, indicated in the following stanza of the .seq24rc set to 1 if you want seq24 to create its own alsa ports and not connect to other clients 0 This 0 in the last line is a user-friendly setting, because as you've...

Backing Up the Codebase

In order to create a back up of the codebase, use your FTP client to connect to your server. Ideally, for reasons of download speed and stability, this should not be done over a wireless connection. When the download is complete, you will have a full copy of your working codebase saved on your computer. Later in this chapter, we will cover using the command line to speed up this process, but, for those of you who want to avoid the command line, you can make adequate backups of your codebase...

Setting Up Your First Forum

To enable the Forums module, click on the Modules link in the top menu and scroll down the page until you see the Forum module. Check the box associated with the module and click the Save configuration button at the bottom of the page. Drupal will install the Forums module. The next step in the process is to set permissions for forums. Here are the permissions that you can Create new forum topic content Edit own forum topic content Edit any forum topic content Delete own forum topic content...

Preparing the Node for Display with hookview

The hook_view hook is called once a node object has been loaded, but before the node has been displayed. It gives us a chance to prepare that node for display before passing it on to the theme engine. Why do we need a function like this Because Drupal doesn't know what to do with the extra fields of our content type. For example, our data has not been checked and escaped for display in the browser. In addition, the theme system does not have any information regarding how it should display our...

Browsing the Issue Queue

Every module on Drupal.org has a project associated with it, and every project has an issue queue. The complete issue queue can be found at http drupal.org project issues, and the issue queue allows you to filter on specific modules. The projects associated with each module are used to track potential bugs and questions about the specific module. If you are having problems issues with a specific module, you can often find other users reporting similar issues. If you end up needing to post a...

Widget type text area multiple rows

Click the Save button this brings up the admin screen where you can configure the field. These settings apply only to the Brief bio field as it appears in the Profile content type. Rows Enter your brief bio. 500 characters maximum. Instructions to present to the user below this field on the editing form. Allowed HTML tags lt a gt lt b gt lt big gt lt code gt lt del gt lt em gt lt i gt lt ins gt lt pre gt lt q gt lt small gt lt span gt lt strong gt lt sub gt lt sup gt lt tt gt lt ol gt lt ul gt...

Template Files

These are the default template files with a theme Block within a sidebar block.tpl.php Generic container for the main area of the site box.tpl.php Comment theme comment.tpl.php These files can then be edited with our favorite text editor and we can import our design into the template files. We now need to examine each of these files and transfer our HTML template to these, and replace the CSS file with the one from our template. If we start with the page.tpl.php file we can get a basic design...

Learning Goals 1

By incorporating the student-generated links into your classroom plan you can achieve several goals 1. As students create resources that become incorporated into the daily work of the class, they get the opportunity to view themselves and their peers as active participants in their learning environment. 2. By using student-generated links to spark discussion, you reinforce the notion that all participants in the course students and teacher have a role to play in creating course content. 3. By...

What is an Attachment view

That, in a nutshell, describes views at their simplest. Now, how about Attachment views Well, to continue using the same example, let's say that our requirement has changed, and we don't always want a page based on every node having to do with travel, but want to be able to select destinations from a list of regions shown on the same page, as illustrated in the following figure. North America Pasific Island South America The box on the left shows the available travel regions, each of which is a...

Hope You Like JAMin Too

The core tools of the digital audio mastering engineer aren't all that different from those used in the mix compression, limiting, and equalization again. The main difference is that mastering plug-ins are generally less invasive, because they're not meant to have an obvious effect. You're only supposed to notice the increase in average level and how much better the mix translates to different playback systems, not any change in tonal color or increase in distortion. It's possible to master a...

How Can I Update Modules Easily and Cleanly

and reflect all that in the version control repository without painstakingly adding, removing, and committing individual files Here's the thing you want to be able to deploy a unique snapshot of your project at any time from the repository, which will be as easy as plunking down a SVN checkout or update on top of a fresh Drupal release install. You saw in the previous chapters how this involves including in this project a state snapshot including all the modules third-party ones you have...

Configuring Blocks

You can select various configuration setting for blocks on the Blocks Administration page. The configuration options include overriding the title of the block and setting the visibility of the block based on several optional parameters. As an example of how you might use these features in the future, let's change the Who's online block so that it only appears on the homepage of your site, and only when the visitor is a user who has logged into the system with a user ID and password. To make...

Basic Ubercart configurations

Now, at first glance, Ubercart can look like a very hostile animal indeed, with many pages of daunting features. However, this needn't be so. Just imagine it as a feast, and you only need to take what you need from the whole table and leave the rest for later, or for other people with more varied tastes. Firstly, we must enable Ubercart and all of the dependent modules, as indicated by the Modules table. Without the following modules Ubercart will not function, and so they must be enabled prior...

DinoSpace

Throughout this book, we are going to create our very own social networking web site using Drupal. This web site is called DinoSpace , and it is aimed at the owners of pet dinosaurs yes, I know, nobody really owns a pet dinosaur .it would be too expensive and impractical to interact with one another. In particular, the web site aims to Connect owners of pet dinosaurs and allow them to build and maintain friendships with other users Allow owners to share stories about their pets Help in...

Adding a Menu Item for an External Page

You can add links to external sites by adding a menu item. To do so, click on the Structure menu item at the top of the page. On the Structure page, click on the Menu link. On the Menu page, click on the Add item link for the Main menu. You should now see the Add menu item form see Figure 5-4 . Enter a title in this example, I used Apress as the menu title , the path, which is the full URL to the external page to which we want to link in the example I used www.apress.com , ensure that the...

Example Setting up Cron using cPanel

If you have a hosted account you may have a control panel that grants access to cron job configuration. 1. Logon to your host cPanel and click on Cron jobs. 2. Select to start with the Standard option. 3. The Standard interface does not offer the option to run cron every 30 minutes. If we choose 30 minutes here, it will run cron once per hour at half-past the hour. Select 30 minutes. 4. Enter a command to run such as the following usr bin curl --silent --compressed http www.example.com cron.php...

Page Content Drupal Messages and Help Text

Content is the most important part of your Web site. You must tell Drupal where to insert content into the page template This is done with a simple variable, content. You may place this variable anywhere in the template file page.tpl.php. From this simple variable, Drupal may present a single node, or a list of nodes, or whatever else Drupal may prepare as the content for any given page. You must also print the title for this content using the variable title. It is different than the variable...

Step Creating the Business Objects

Normally in Drupal, you click the ubiquitous user login block to either log in or register to become a new user. Given the objectives here, however, you can do away with the regular user login registration block and configure Drupal so that only the Translator Team Leader can register users. Instead of registering directly, Clients will fill out a Client Application form, Translators will fill out a Translator Application form, and the Translator Team Leader will then manually create the users,...

Menu system 1

The Drupal menu system got a complete rewrite. The new features include The administrator may now customize the menu to reorder, remove, and add items. Menu items may be classified as local tasks, which will by default be displayed as tabs on the page content. The menu API is much more consistent with the rest of Drupal's API. The menu function is no more. In its place, we have hook_menu . The old hook_link remains, but will no longer be called with the system argument. The hook reference in...

Search

Note the grey circle near the end of the search box. That is the location of the throbber icon. When the autocompletion AJAX script is running, the throbber icon will be displayed as a spinning circle. Let's now turn to the anonymous function that is run inside the each function .each function var newld this .attr 'id' '-autocomplete' var newElement ' lt input type hidden gt ' .addClass 'autocomplete' .attr 'id', newId .attr 'disabled','disabled' .attr 'value', SearchAutocomplete.url In a...

Radio Buttons

Radio buttons are useful when you want to present the author with a list of values from which they can select only a single item check boxes are used when you want the author to have the ability to select one or more values . We will expand our Event content type to include the ability to select the type of seating that will be available at the event either reserved seating or general admission. To start the process, click on the Structure link at the top of the page, followed by the Content...

Securing Deploying and Maintaining Your Shop

Our store is now fully working and can handle taxes, payment, and shipping let's now look at securing, deploying, and maintaining our store. If we are working on our store on our own computer and not online, a few things could not work correctly such as the pingback requests from PayPal so we will have to make a few changes. Password and phishing security Handling orders although we will look at it in more detail in Chapter 11 Invoices and CRM Backing up and restoring your store We need to...

Adding BlockEditing Capabilities to a Theme

If you have chosen a different parent theme as your subtheme, you will not have access to the Zen Edit block function. Moving the functionality from the Zen theme to your own theme is not difficult, however, and requires only careful copying and pasting. Follow these steps to merge the necessary Zen functions into your own theme 1. Open the Zen theme file template.php and copy the contents of the function zen_preprocess_block. 2. Open your own theme's file template.php and look for the function...

Creating a Horizontal Menu

The next requirement for our new theme is to create a horizontal menu that appears below the header. The first step in this process is to add a new region to the theme. To add a new region, edit the genesis_mytheme.info file and add the following line to the end of the list of regions contained within that file regions main_menu_links Main Menu Links This code instructs Drupal to include a new region with an internal name of main_menu_links to the list of available regions. The value to the...

Using Relative Path Names

Within your Drupal folder, the names of files and subfolders are the same whether you are running in localhost on your own computer or in a path to an IP address or a domain name which in turn may be a subdomain or a folder within the domain . Rather than repeating this throughout the book, files and folders within your Drupal director are identified by relative path names that begin with a dot. Any relative path name that is not otherwise identified is relative to your Drupal folder wherever...

The searchtotal table

Take a look at what the search_total table contains after indexing example nodes 2 and 3 raysql gt select from search_total order by count desc word 1 count j____________i___________ Figure 20 Global normalized totals for the words in the index. After each time that indexing occurs, all of the words that have been marked by search_dirty will be updated in the search_total table. The count value is a normalization according to Zipf's law that says a word's value to the search index is inversely...

The allowed domain and crossdomainxml

The allowed domain is the value that gets populated within the crossdomain.xml file of our Drupal site. The crossdomain.xml file is a file used by Flash to determine which sites it can communicate with and which sites it cannot. The Services module automatically generates this file using the Drupal menu system. We can see the contents of this simulated file by visiting our domain followed by crossdomain.xml, such as Although we do not have a crossdomain.xml file within our Drupal root on our...

Virtual Reality

Humans have literally dreamed about virtual reality for probably their entire existence. Every night, each of us enters a simulated reality that competes with the world we experience during our waking state. The Taoist philosopher Zhuangzi, in a well-known musing, dreamed once that he was a butterfly. Upon waking, he wondered if it were he that dreamed of being a butterfly or if he were the butterfly dreaming of being Zhuangzi. Though it seems a pipe dream to build a simulated reality that can...

Converting a Drupal x Theme to a Drupal x Theme

Drupal themes have changed radically from version 5 to version 6 however, there is no reason to change the design of page that is displayed to Web site visitors when you upgrade the theme from one version of Drupal to another. Keeping this point in mind, you should find it a relatively quick task to upgrade a theme with only a few minor changes to your current theme files. Work through the following checklist to create a Drupal 6 theme 1. Create an information file for your theme. This file...

Cropping and Resizing

After your video material is loaded into Avidemux and is playing back correctly, and you can hear the sound, you can use the editing features in the program before you perform the output encoding. Often, if you're preparing video for the Internet, you have to reduce the resolution, change the aspect ratio, or cut it in length. Skipping this step may mean your video is edited or resized automatically by the video server, which can lead to unacceptable results. Suppose you have some digital...

Populate the Primary Links

In this step, we will add some useful links into the Primary links menu. As you populate the Primary links, think about the work your site members will be performing. You want your primary links to act as doorways to their most commonly-performed tasks. The process for adding menu items into the Primary links is just the same as moving them into other menus. As shown in the following screenshot, when editing an existing menu item, select Primary links as the Parent item. The maximum depth far...

The Basic Page and Article Content Types

When you install Drupal 7 you automatically receive two content types that have been defined by the team who maintains Drupal core the Basic page and Article. If you author a piece of content using the Basic page content type you will see that it provides two basic fields a title and a body. An author using the Basic page content type simply enters a title a required field as indicated by the red asterisk and the text of their content in the body field. The body field is flexible and can...

Items Per Page

If you decide to use a pager for your view, you can set the number of items that will appear on each page by clicking on the small gear icon to the right of the Use pager option. Clicking on the gear reveals a form where you can set the number of items that will be displayed per page, the offset think of the offset as the starting item for your view for example, if you want to skip the first 10 items and start at number 11, you would enter 10 in the offset field , the pager ID in nearly every...

Connecting to Multiple Databases Within Drupal

While the database abstraction layer makes remembering function names easier, it also adds built-in security to queries. Sometimes we need to connect to third-party or legacy databases, and it would be great to use Drupal's database API for this need as well and get the security benefits. The good news is, we can In the settings.php file, db_url can be either a string as it usually is or an array composed of multiple database connection strings. Here's the default syntax, specifying a single...

Content profile

Location This module builds user profiles as content also known as nodes , which opens the opportunity to use all the powerful modules for content for user profiles too, for example, the Content Construction Kit CCK . It's intended to be simple and useful, but extensible by further modules. The setting for Content Profile is an extra pane in the content type settings. If checked, that content type is used as the user profile. If unchecked, as shown next, that particular content type will not be...

Embedded Media Field

Finally, we come to the alternative of hosting video from our own servers. Although using a module such as Media Mover combined with services such as Amazon S3 nukes serving video a slightly easier task than it might have otherwise been, for most sites the bandwidth required for serving video is generally not a viable option. Additionally, sites may wish to take advantage of the viral opportunities of hosting video through a widely recognized provider such as YouTube or Blip.TV. There are...

Configure the Base Content Profile Settings

To configure the base Content Profile settings, click on the Administer Site building Content types link, or navigate to admin content types. Click the Edit link for the Profile content type. Then, click the Content Profile tab. The base settings allow us to configure how the node profile will be displayed on the user profile page. As shown in the preceding screenshot, in the User page display style section we have four options Don't display this content profile on the user account page only...

Installing a Drupal theme

After you have decided the best theme to go along with your online store, you should follow these steps to install it. This is a rather straightforward procedure, very similar to the one performed in Chapter 2, Installation of Drupal and Ubercart, during module installations 1. We will go through installing the second most popular Drupal theme according to Drupal.org statistics. Go to http drupal. org proj ect acquia_marina and click on the download link next to the 6.X-1.9 version. By jwolf on...

ReArranging Blocks

It is likely that, at some point in time, you're going to want to re-order how blocks appear on a page. In the previous example, we may want to have the Who's new block appear above the Who's online block. To re-order the blocks, navigate to the Blocks page by clicking on the Structure link at the top of the page. On the Structure page, click on the Blocks link. Once on the Blocks page, simply click and hold the plus sign next to the block that you want to move, and drag that block to the...

Use Pager

For lists that will contain dozens or hundreds of items, you can limit the number that appear on a page usually to 10 or so and use a pager at the bottom of the page instead. A pager looks like this lt lt previous 1,2,3,4,5,6,7 next gt gt . Visitors use the pager to navigate through all of the items. Views automatically creates and displays the appropriate pager based on the number of items that are in the complete list. By default, the Views module renders lists using a pager with 10 items per...

Local Video Files

When serving local video files, we have to consider first how a video will be placed onto the server and if we require any manipulation of the video. We may wish to use an upload field from a web form, or we may wish to use FTP to upload large files, or we may wish to be able to email a video to the server as from a cell phone. All of these options are available, so we will examine each in turn. The first heavy hitter is the FileField module. This light-weight module goes a long way. At its...

Triggering Hydrogen Drums with Seq

Because the Hydrogen drum machine accepts both MIDI input and JACK transport control, you have two options for synchronizing it with sequences created in seq24. You can either make a drum pattern in seq24 and trigger Hydrogen on MIDI channel 10 or create the pattern in Hydrogen's sequencer and use seq24's play button to get the transport rolling. Hydrogen accepts MIDI input on any channel, but you can get specific by choosing File gt Preferences gt MIDI System gt Channel. If you want to, you...

Permissions

We'll cover the permissions for a core Drupal install here, and for the add-on modules in the appendix. The block module is for creating the blocks that can be placed in various regions on the site. The permissions settings will depend on who will be administering them these particular permissions don't affect their viewing. With this site, the site owners will not be performing site administration themselves, so we will leave those permissions to User 1 the super admin and not assign them to...

Configure the Audio Module

Now that we have installed the Audio module and its helper modules, we need to configure the audio module to support our needs. Click the Administer Site Configuration Audio link, or navigate to As pictured in the following screenshot, you will see three tabs across the top of the page Audio, Metadata tags, and Players. Home gt Administer gt Site configuration The current PHP configuration limits file uploads to 8 MB. Tfiere are two PHP ini settings, upload_max_filesize and post_max_size, that...

Create a Gender field

The Gender field is also built in a similar way to the other two fields, but with a different component. For this field, we will be using the Select component. Therefore, we will need to present options to the user to select from. The values to be entered for this field are shown in the following screenshot This is used as a descriptive label when displaying this form element. Default value The default value of the field. For multiple selects use commas to separate multiple defaults. 0 Token...

WinMerge

While these programs do a nice job in showing file differences visually, side by side, non of them as i can tell allows to actually save the difference in unified format most allow to save a standard diff, though - update TortoiseCVS lets you save patches. It does unified format by default. See its Make Patch option. Note that this 'Make Patch' option can make recursive patches when applied to directories. You cannot specify the -u in the External diff preferences eg diff -u as this will...

Modifying Nodes of Our Type with hookload

The last node-related hook you need for your basic joke module is the ability to add your custom node attributes into the node object as it's constructed. We need to inject the punchline into the node loading process so it's available to other modules and the theme layer. For that you use hook_load . This hook is called just after the core node object has been built, and is only called for the current node type being loaded. If the node type is joke, then joke_load is called. Implementation of...

Shape Tools

Inkscape has a good selection of preformatted shape tools to satisfy the five-year old potato printer in you. These shape tools provide a useful way to start playing around with the possibilities of this application, and it's possible to achieve many different effects. You can manipulate the shapes via their nodes small square ones for resizing, and round ones for reshaping. Drawn shapes are objects by default, rather than paths, but as usual you can convert them to paths with the Path gt...