The standard Drupal comment approval admin page has always been an annoyance to me. The main reason I will toss a comment is that it's spam. You know, like "I love this blog. For a great 3-day cruise..." and the like. The problem with the approval page is that it shows everything BUT the comment.
I recently switched from a mysql.com implementation of MySQL to MacPorts on my local, and the Drupal sites would no longer load.
The MacPorts my.cnf file turns off networking, so that multiple versions of MySQL can be run. In doing so, one must then use socket files to access MySQL instead of TCP/IP. This requires a change to the database config in the settings.php file.
Simply add the path to your socket file as an additional line in the database config array, as follows:
'unix_socket' => '/<path>/mysqld.sock'
You know how to install Drupal the normal way, but there is a shortcut, if you have drush.
Drush provides a command (site-install) for downloading modules. Drupal, itself, is kept as a project in the modules section of Drupal. So, drush can download it, as well. Installing Drupal can be done with another drush command. Here is how to install Drupal, in 3 easy steps:
.swf files contain the information necessary to display Flash animation. In Drupal 6, there was a module that provided an api function swf() to generate the embed code needed. That module isn't available in Drupal 7 ... so what to do?
Are you working in a multi-server environment, such as local, staging and production? If you don't have User 1 (or some other user) access in your local setup, it's easy to remedy.
Enter drush and its user-password (upwd) command. Changing a password is a cinch, whether you know the existing one or not, if you have drush access to the site, which you hopefully do, on your local development server.
drush upwd <username> --password="<new password>"
drush upwd admin --password="let-me-in"
If you've been using Drupal for awhile, you probably understand template hinting and how you can format one content type differently than another, by having a template file such as
Recently, however, I had the need to format a single content type differently depending on where it was presented:
Have you ever wanted to have a menu item open in a new window, when clicked? The standard menu dialog does not offer the option of a target for the menu link. So, what to do? A little jQuery magic!
1. Inspect the menu item, or view the page source, and find it's id...something like this:
<a href="wherever">My menu link</a>
2. Add the following snippet to your theme. How you will add it depends...see the footnote at the end:
Implementing Option-only Pricing in Drupal Commerce (D7)
Drupal Commerce can be confusing to get one's arms around, even if (or especially if) coming from using Ubercart or some other relatively point-and-click cart. I recently had the need to do something I considered a simple requirement, and having retail experience, something intrinsic to most catalogs: products with option-only pricing.
Have you moved a Drupal site to another server and received the error 'The directory sites/default/files is not writable' ? The site worked on the previous server, and the permissions seem the same. Ah, an easy fix...make the permissions for the files directory 777. Noooo!
Let's take a look at what the numbers in the permissions setting mean.
There was a time not too long ago that I thought this book would never make it to the shelves. The original idea was to have the release date coincide with Drupal 7. So what happened?