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 and more. 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.

Thinking of creating a Drupal site but don’t have the creative juices flowing? There are many graphics design companies such as Phorm ready to take on your business.

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 & Categories 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
Webform
And more…

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. 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 spam microblogs:

  • 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.
  • Form Builder allows users to build entire Form API structures through a graphical, AJAX-like interface.
  • 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 WordPress does not.

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.