Amazon.com is one of a large number of web-based businesses that have opened up their product information databases for other sites to access. In the case of Super Duper Chefs, we want to retrieve useful data like product photos, pricing, and manufacturer information for display on our own website. The Amazon module for Drupal allows us to do just that. In this lesson we'll take a look at the Amazon module, by starting with:
- What’s Included?
- Locale
- Referral settings
- Amazon keys
Additional resources
In a previous lesson in this series, we set up a content type for our product reviews. Now, we’re ready to add a field to store a link to the product on Amazon.com. In this lesson we'll:
- Enable and configure the Amazon module
- Get our Amazon key
- Add the Product Field
Note that Amazon changes the way they manage keys over time, so the way they are generated in the lesson may have changed. Please review the official AWS Product Advertising API documentation for current key generation instructions.
Additional resources
Giving visitors a chance to evaluate and rate content is an extremely common pattern on content-rich websites. In addition to giving visitors a way to jump to the best content, it can give you a way to determine what content on your site is most effective. In this lesson we'll discuss:
- Voting API module
- Fivestar module
Additional resources
For the Super Duper Chefs site, we’ll be using both of the Fivestar module’s unique features: adding a static Rating field to the “Product review” content type for the editors to use, and attaching a voting widget to the comment form on each review for the site readers to use. That approach will keep the official rating on each review separate from the reader ratings. In this lesson we'll:
- Add the Product Rating Field
- Add the Reader Rating Field
Additional resources
Drupal’s theming system gives designers complete control over how a site’s content is rendered for a web browser, and custom themes can give any site a distinctive look. But sometimes it’s useful to make minor tweaks to a site’s appearance using nothing but CSS rules. They allow designers to tweak font sizes, colors, and so on without altering the underlying HTML that defines the site’s structure. In this lesson we'll look at:
- CSS Injector module
- Explain how this works
Additional resources
Although our “Product review” content type has all of the data we need, the individual reviews still look a bit untidy. In this lesson, we’ll do some final tweaking to make the review display look nice and tidy.
- Setting Field Display Options
- Configuring CSS Injector
Additional resources
Now that we have a few products, we really ought to add a listing page that lets visitors look over all of the products that have been reviewed, comparing official ratings with visitor ratings and sorting by various criteria. This is a perfect job for Views. In this lesson:
- Create a Product Finder view
- Display Amazon information
- Display voting results
Additional resources
This video shows you how to download and do the initial setup of MAMP, which is Apache, MySQL and PHP for Macintosh. It shows some basic configuration tweaks to change the port from 8888 to the default of 80 so that you can just visit the localhost in the browser and get your Drupal installation to appear. It also provides a general orientation to MAMP, and some other initial configuration setting changes.
Next up: MAMP Server Configuration
Additional resources
More information on Development Environments
In this lesson, we will cover the basics of getting code into version control using the Mac app "Tower" and then making the first commit and pushing it to the remote repository we will setup on beanstalkapp.com.
Features is a module which generates modules for us. You can then extend that module just as you would any other Drupal module. In this video we'll add some additional code to our feature to make it more complete for our needs, outside of the realm of what Features itself can provide.
The features module (and the drush command) are pretty smart about not overwriting custom changes, and your chances of overwriting your custom code are pretty slim. When features exports a module it creates a .module file with only one line of code in it. Which is an include for another file: mymodule.features.inc. Features then puts all of the automatically generated code into this included file. When you regenerate or update a feature it just uses the existing mymodule.module file which maintains any code that you wrote, and then regenerates the mymodule.features.inc and associated files.
Additional resources
Features project (Drupal.org)
Introduction to Drush Series (Drupalize.Me)
https://github.com/DrupalizeMe/drupalize-lullablog (GitHub.com)
James Sansbury defines Features (a module that helps organize site components and applications for specific use cases), as distinct from Nodes and other forms of site content.
Prerequisites
This series assumes that you can install Drupal 7, create a basic content type, create a basic view, and use Drush. See the following resources if you need a refresher:
- Create a New Content Type
- Creating a New View
- Introduction to Drush series
- Installing Drupal with Drush
Additional resources
Features project (Drupal.org)
We'll create our very first feature and then see how it works by putting on our production site and enabling it.
Additional resources
Features project (Drupal.org)
Introduction to Drush Series (Drupalize.Me)
Hands-On: Generating Sample Content (Drupalize.Me)
https://github.com/DrupalizeMe/drupalize-lullablog (GitHub.com)
This video walks through some of the most common and important server configurations for running a local development server on WAMP. This will show you how to enable the Apache rewrite_module through the WampServer graphical user interface, and where the http.conf configuration file is located. It also walks through the process of creating aliased folders so that you can organize your files in your directory structure and still have it available in the localhost via your browser. The video also shows how to change the max_allowed_packet from 1M to 2M via the my.ini file, and how to up the memory limit from 128M to 256M via the php.ini file stored in the bin folder within the Apache version folder.
To learn how to install WampServer, see the Installing Wampserver tutorial.
Additional resources
More information on Development Environments
Before we set up a multisite we need to understand how Apache and Drupal work together to deliver the site we intend. In this lesson we'll look at the documentation for Drupal multisites, and then discuss the way you need to set up your Drupal directories. We'll also review the workflow that Apache and Drupal go through to get the correct site displaying in the browser.
Additional resources
Multi-site - Sharing the same code base (drupal.org)
In this lesson we'll be building a simple university site, udrupal.com, with different areas, each with their own website: the main site, a news site, and an alumni site. The news site is simply a subdomain of the main domain name, news.udrupal.com, and the alumni site actually has its own separate domain name, udrupalalumni.com. To get this done, you're going to learn how to confirm the DNS is working for the domain names. That is, that they are currently pointing to the right server. Then we're going to configure an Apache vhost on our server so that Apache knows where to find our Drupal code base. We'll finish things up by installing our main Drupal site, udrupal.com.
Additional resources
With our domains and Apache configuration in place, we need to make sure all three sites can be installed at the different domains by creating our multisite directories in the sites folder. In this tutorial, we'll create the necessary Drupal site directories and settings files for the three sites so they are all running smoothly, check the domains and install the other two sites, and wrap up by changing the theme on the alumni site.
Before we get started, you should make sure you have two empty databases created for the two new sites we'll be installing.
In this tutorial we're going to be working directly on a server using the command line. You can feel free to use a GUI interface for your site, like an SFTP app or just your local machine file browser and editor apps. If you want to brush up on using the command line, you can check out our free Command Line Basics series.
If we want to do development work on the university multisite, we need to do a few things to have this run smoothly in a local development environment with all of those URLs. The sites.php file is going to let us define aliases for the site configuration folders in /sites
. In this tutorial we'll explain why local development with multisite is tricky, and how to get it set up properly.
Additional resources
example.sites.php (api.drupal.org)
Drush is a really great tool for managing your Drupal site quickly and easily. If you don't already know about Drush, you should definitely check it out. When working with a multisite installation though, Drush can get confused if you don't give it all the information it needs. In this lesson we'll walk through how to use Drush properly with a multisite installation, covering both how to manage just an individual site and how to work with all of your sites at the same time.
One of the best ways to improve both the speed, and relevancy, of search results for a Drupal site is to stop using the Drupal core search module and start using Apache Solr. Solr is a Java-based application that provides an API for interacting with Apache Lucene via HTTP to facilitate the creation of excellent applications for performing full-text content searches, with a special focus on internet-based search applications. The quick pitch for why you should use Solr is it's insanely fast, especially when compared with Drupal's default Search module, and it can be scaled to handle millions of search queries per second and huge piles of data.
Since Solr is a third party application we need a way to bridge the gap between Solr and Drupal. Really, there are two parts to this puzzle: getting the data out of Drupal and into Solr so it can be processed and indexed, and passing a search query from Drupal to Solr in order to retrieve, and display, search results. For that, we'll use the Search API module, and the Search API Solr module.
In order to demonstrate a real-world use case we'll pretend that we're the owner of a website that contains a database of fish species. As the database has grown over time we've begun to feel the limits of Drupal's MySQL full-text search and want to improve our search tools. Using Solr will allow for better matches in full-text search, faster searches, and a lot of additional functionality like partial word matches, spell checking, facets, and more.
In this series we'll cover:
- What Apache Solr is and why you should consider using it
- Installing Solr and configuring it to work well with Drupal content
- The contributed Search API module
- The contributed Search API Solr module
- Configuring Drupal to send content to Solr for indexing
- Retrieving search results from Solr and displaying them in Drupal on both a stand-alone page and with the Views module
- Using Solr field boosting to influence result relevancy
- Using the contributed Facet API module with Solr to allow for faceted search results
- Configuring stop words, synonyms, and promoted search results in Solr
This series is for anyone that wants to improve the quality of the search functionality of their Drupal-powered site. There is some system administration required to install Solr, but it's pretty straightforward. Almost everything else is done via configuration in Drupal's, or Solr's, user interface and by editing simple XML configuration files. So, no PHP, or module development experience required. We do however assume that you're already familiar with basic Drupal administration.