Drupal 7 for WordPress Admins

WordPress continues to become more and more sophisticated as time draws on, with a constantly improving admin dashboard and easy-to-use plugin architecture. And themes like Twenty Eleven give both bloggers and web developers something to appreciate. But while WordPress is a great CMS for personal blogs, it’s not well suited for more complex applications such as e-commerce, discussion forums, or collaborative wikis. Drupal, on the other hand and by design, excels at all of the above. This article will look at some of the similarities and differences between WordPress and Drupal 7, explain how to accomplish some of the less intuitive administration procedures in Drupal, share some newbie gotchas and timesavers, and provide a list of modules useful to get a new Drupal site off the ground. It is assumed readers are new to Drupal but have a familiarity with using the WordPress blogging platform.

Similarities between WordPress and Drupal

Drupal and WordPress aren’t all that dissimilar at first glance. For instance, both of them are CMSs. Both run using PHP. Both allow users to install different themes and plug-ins/modules. And both can be used to create a blog. Even when moving between the CMS dashboards not a lot changes. Listed here are a number of comparable features and the different terms used for them between the two apps:

WordPress 3 Drupal 7
Users People
Settings Configuration
Plugins Modules
Posts, Pages & Media Content
Widgets Blocks
Menu Menus
Tags Taxonomy
Themes Themes

As you can see both Drupal and WordPress contain a number of similar features, even with similar names. But regardless of the name, not all of the features are exactly alike. For example, due to its modular nature and dependency management capabilities, Drupal users will find themselves installing and managing a greater number of modules. Some modules must be installed on top of the Drupal core simply to achieve the same level of functionality provided by WordPress out of the box, such as with Drupal’s URL aliases and Pathauto. However, the flexibility and extensive configuration options typically built into Drupal modules often outweigh the additional effort involved in setting them up correctly. This is one area where WordPress and Drupal begin to diverge.

Differences in content management underpinnings

WordPress and Drupal content types draw clear comparisons, mainly due to the limited set of types available in WordPress. Notice how Drupal can contain a number of content types whereas WordPress uses only two. In Drupal, not everything is a page or a post as with WordPress:

WordPress 3 Drupal 7
Post Article
Page Basic page
Blog entry
Book page
Poll

Another area where Drupal stands apart from WordPress is in its extensible, open-source architecture. Based on the concept of building with nodes and views, Drupal gives a number of ways to customize the site. However, the in-depth customization capabilities also present a small learning curve for users more familiar with WordPress.

Tricky site administration concepts in Drupal

The following administration concepts are not immediately obvious when coming from WordPress to Drupal:

  • Creating PHP snippets
  • Injecting custom CSS into a theme

PHP snippets provide a method for executing PHP code from an arbitrary block of content sitting in one of the theme’s block regions. Snippet blocks can supplement existing modules or function as self-contained module replacement. To create one first enable the PHP filter module, pre-installed as a part of Drupal 7 core. Once enabled, add a new content block and choose the PHP code content format. Enter PHP code into the block body, name the code snippet (consider prefixing with “Snippet:”, and save and position in one of a theme’s block regions to activate.

Cosmetic tweaks can be made to the site using CSS Injector. For example, DISQUS users viewing the comment system using the Drupal 7 Garland theme may notice alignment issues in the DISQUS UI as a result of cascading bullet styles. To resolve this issue add a CSS injector rule titled “Garland-Disqus List Style Fix” and enter the following code:

#dsq-content li,
#dsq-recentcomments li {
list-style: none;
}

Save any changes and reload the page, or, if CSS caching is enabled, clear the cache from the Performance section of the site’s Configuration.

Drupal newb gotchas and timesavers

A few tips that just may save a frustrating amount of time digging:

  • If a timeout error occurs during module installation of or while saving configuration, increase the memory limit in PHP.ini. It is possible for timeout errors to cause partial module installations which, if left unaddressed, can lead to confusion later on.
  • When installing libraries for the Wysiwyg module buttons may not be visible by default, true for all libraries in Drupal 7.10. Individual buttons can be enabled, however, via the Buttons and Plugins dialog accessible from the Wysisyg profiles list (look for the Edit link). If no buttons are enabled for the library installed it may appear as if Wysiwyg or its libraries are not functioning properly, so don’t be fooled.

Modules to get Drupal up and running quickly

The following list of Drupal 7 modules was compiled as canthespam.org was pieced together and represents a list of some of the modules used to create one of the world’s first and only spamblogs:

  • Start with the Drupal 7 top ten contributed modules which includes must-have modules such as Google Analytics and Webform as well as other modules likely to be rolled into the core for the Drupal 8 release.
  • DISQUS is a comments platform that helps you build an active community from your website’s audience.
  • Fivestar adds a clean, attractive voting widget to nodes in Drupal 5, node and comments in Drupal 6, and any entity in Drupal 7.
  • Mollom is an “intelligent” content moderation web service. By monitoring content activity on all sites in the Mollom network, Mollom is in a unique position to determine if a post is potentially spam; not only based on the posted content, but also on the past activity and reputation of the poster.
  • Gravatar integrates Drupal user pictures with the service provided by Gravatar, a globally recognized avatar.
  • Colorbox is a light-weight, customizable lightbox plugin for jQuery 1.3 through 1.6. This module allows for integration of Colorbox into Drupal.
  • CSS Injector Allows administrators to inject CSS into the page output based on configurable rules. It’s useful for adding simple CSS tweaks without modifying a site’s official theme. There’s also a JS Injector based off CSS Injector currently in development.
  • Twitter provides API integration with the Twitter microblogging service and (theoretically) API-compatible alternatives like Identi.ca.
  • Global redirect is a module that performs 301 redirects and helps prevent crawlers from indexing a single page from multiple paths.
  • XML Sitemap creates a sitemap that conforms to the sitemaps.org specification.
  • Shortcode provides a shortcode API and basic shortcodes through Drupal filters.
  • AdSense provides web content providers with the means to earn revenue from visitors by displaying ads from Google AdSense™ advertising service on their sites.
  • Location allows real-world geographic locations to be associated with Drupal nodes, including people, places, and other content.
  • Backup and Migrate simplifies the task of backing up and restoring your Drupal database or copying your database from one Drupal site to another.

Summing things up

As explained in this article, WordPress and Drupal share a number of similarities and differences. At the surface level both share a lot of dashboard features in common. But both CMSs have some significant differences in their use content types, and management and display of data. The article explored similarities and differences between WordPress and Drupal, explained some of the less intuitive site administration concepts, shared a number of gotchas and provided a listing of useful modules for starting a new site. Drupal is a significant departure from the polish WordPress site administrators may have grown used to, but it also offers many additional capabilities not suited for WordPress.

SMS Spamblog

Link

Started a new website to blog the endless droves of SMS spam texts I receive: Can the Spam. Unfortunately after several days of little to no organic traffic from Google I started asking around for suggestions. One kind soul suggested that using AdWords might help boost organic search traffic. After about three days using AdWords the ad campaign was disabled in violation of the AdWords bridge page policy. I’m guessing that’s the main reason Google isn’t sending much traffic. Hopefully links copied from the text messages aren’t being considered as affiliate links. I’ve gone through and tweaked them so the site now shows a warning pop-up dialog before users are redirected to untrustworthy links in a pop-up window. And now I’m hoping some of the link juice from this post will help bump the site’s credibility. But only time will tell…

Get started with PHP in Eclipse

Eclipse is a powerful IDE supporting many different languages, including PHP. Unfortunately, many Eclipse installations do not provide PHP language support right out of the box—some assembly required. This article will focus on getting Eclipse set-up for PHP development and local debugging.

To get started, first download and install the PDT plug-in for Eclipse. PDT installation instructions are available on Eclipsepedia. Once installed, a PHP perspective will become available, providing PHP syntax highlighting and code completion, as well as the ability to create PHP project types. The basics are now in place for developing PHP applications, save for local debugging.

Debugging PHP apps locally requires users to install a separate debugging tool. Two currently available PHP debugging solutions include XDebug and Zend. We will focus on getting set-up using Zend as it is relatively easy to install and use. We will not discuss XDebug because, at the time of writing, attempts to get XDebug up-and-running ended in nothing but frustration.

To use Zend for PHP debugging first download and install PHP, if not already available, which is required for Zend to work properly. With PHP installed, download and install Zend Server CE, the free community edition. When the server is running return to Eclipse to configure it to use Zend:

  1. Start or restart the Eclipse IDE.
  2. Create a new PHP Project in Eclipse.
    Note: Eclipse may default the project contents to the local Zend server. This can be changed if desired so that projects are consolidated in a single workspace.
  3. Open project Properties dialog and enable project specific settings from the PHP Debug panel.
  4. If not already selected, choose Zend Debugger as the PHP Debugger and set the Base Path to “/”, the local root.
    Note: Zend CE restricts users from hosting multiple PHP projects simultaneously.
  5. Choose OK to save settings and close the Properties dialog.

With Zend installed and Eclipse configured it should now possible to debug PHP on the localhost. To do so create a simple PHP file of the hello world variety, select it in the PHP Explorer (visible from the PHP Perspective), press F11 or choose Debug As… and select PHP Web Page from the Debug As dialog. The Launch URL should be something like http://localhost/index.php. If the Launch URL includes the project name, Zend debugging may not function as expected.

Once debugging is started the browser will open as well as the Debug perspective in Eclipse. The Eclipse Debug perspective will be stopped on the first PHP instruction encountered and ready for debugging. Press F8 to resume processing and then switch back to the PHP Perspective. Local PHP debugging is now available.

Running Ice Cream Sandwich on the HTC HD2

The HD2 proves yet again to have been a great purchase. Just as soon as Android evolved to version 4.0 with ICS so too did ICS AOSP Hit the HD2. Continue reading to learn how to direct-boot Ice Cream Sandwich using Nandroid on the HTC HD2.

To get started, complete my existing instructions to install HSPLupgrade to a new radio and install MAGLDR. These updates are needed to flash custom ROMs on the HD2. (Note: cLK can be as an alternative to MAGLDR in some cases, but both require HSPL be installed first.) Installation times vary widely by skill level. Once installed, return here to finish the rest.

As a debugging tool for beta ROM installations download and store a functional copy of Android Gingerbread on the SD card, in case there is a need to revert from ICS to an earlier, bug-free version of Android. The Gingerbread ROM I used to use worked for me.

Download and install Ice Cream Sandwich from the XDA forums. (See my most recent configuration for ideas on which to install.) With MAGLDR it is easiest to upgrade using the ClockworkMod Recovery utility, accessible via the MAGLDR main menu once installed. To access ClockworkMod Recovery, enter MAGLDR (reset phone with “shut down” key depressed) and choose “AD Recovery” from the main menu. The resulting menu system provides methods for installing and restoring ROMs from ZIP archives stored on the SD card. (Note: If upgrading from an existing Android NAND ROM, the system partition size may need to be increased before installation as per the ROM instructions.)

Video depicting ICS installation procedure using CWM Recovery.

If installation problems occur please be sure to follow all of the instructions provided with the ROM. Once installed, if things seem buggy, consider direct-booting Gingerbread, or, if using the old dual-booting Android and WinMo, switch over to a direct-boot method such as this one. Or simply try simply copying the set-up below. Those with an Android password management system will revel knowing how much time their careful planning has saved them once again.

HD2 set-up (last updated ):

Device: TMoUS HTC HD2
HSPL: CotullaHSPL3 (SPL-2.08-HSPL)
Radio: 2.15.50.14
Boot Loader: MAGLDR v1.13
Android ROM: NexusHD2-IceCreamSandwich Beta6
Recovery: ClockworkMod Recovery v1.3

Push Upstream with EGit and Eclipse Indigo

While working through the EGit User Guide I ran into difficulty pushing files upstream using Eclipse Indigo SR1 (build 20110916-0149). The difficulties manifested themselves at first with an “auth failed” error, which was quickly resolved with a visit to Stack Overflow. But after fixing that problem I began seeing the following error while trying to push to a remote repo:

Cannot get remote repository refs.
Reason:
ssh://git@github.com:22: Passphrase for C:\Users\...\.ssh\id_rsa

Initial research indicated that Eclipse/EGit SSH authentication has problems. So I just kept messing around until I was able to get things working. After a little Googling and even more fiddling I found two solutions:

Simple fix that skips the passphrase and uses only Eclipse

  1. Use ssh-keygen from Git Bash, or Eclipse, to generate an RSA key, but do so without setting a passphrase.
  2. Open and copy the public key from ~/.ssh/id_rsa.pub and add it to GitHub via the SSH Public Keys section in Account Settings.
  3. Restart Eclipse. (Note: Not doing this was tripping me up for a while.)
  4. Try the Push Upstream steps again from the EGit User Guide.

The obvious pitfall here is that a passphrase cannot be associated with the RSA key. If skipping the passphrase is out of the question the following solution a little more up your alley.

Use PuTTY for file transfers over SSH from within Eclipse

  1. Download the following PuTTY binaries: Plink, Pageant and PuTTYgen.
  2. Use PuTTYgen to generate a new public/private key pair with a passphrase. Open and copy the public key from ~/.ssh/id_rsa.pub and add it to GitHub via the SSH Public Keys section in Account Settings. Save the private key file in your ~/.ssh directory for later.
  3. Run Pageant and add the key created during the last step, entering the passhprase when prompted. Leave this utility running.
  4. Cache the server’s host key in the registry by:
    1. From a bash prompt like Git Bash execute the following command (assumes Plink binary is accessible from the current path): plink git@github.com
    2. Verify the RSA key fingerprint matches GitHub’s and, if they match, choose to store the key in the registry.
  5. Add a new environment variable called GIT_SSH and point it to the downloaded Plink binary (e.g. “C:\Windows\system32\plink.exe”). EGit will attempt to use this binary for SSH, if configured.
  6. Restart Eclipse, ensuring Pageant is still running with the private key available.
  7. Try the Push Upstream steps again from the EGit User Guide.

If done correctly, Eclipse should allow pushes to the remote repo without any further configuration, though Pageant must be running with the private key configured for it to work correctly. If problems continue see the SSH issues in the GitHub help documentation for additional information. Good luck!