4.7.x

Drupal, duplicate content, and you

By Jeff EatonArticle33 comments

Does Google's "duplicate content penalty" harm Drupal sites? No! Here's why.

For years, Drupal has enjoyed a solid reputation as a search engine friendly CMS. It generates relatively clean, standards-compliant HTML out of the box; syncs up the important TITLE tag with semantically useful H1 and H2 tags in the body of each page; and provides short, human-readable URLs with plentiful options for customization. (Anecdotal evidence: several years back, I wrote a post on my Drupal-powered blog that mentioned the name of the company I worked for. Within two weeks, my blog post ranked higher than the company's own web site on Google.)

Recently, I've witnessed a number of discussions where people expressed concern about the way Drupal generates the human-readable URLs that help make it Google-friendly. In particular, they were worried about Google's dreaded Duplicate Content Penalty, a system designed to keep spammers from flooding Google with the same content at dozens (or hundreds!) of URLs. There's a lot of confusion floating around, so for the geeks in the crowd (and the not-so-geeky interested in learning how things work behind the scenes), I thought it would be useful to give a guided tour of how Drupal manages and generates URLs. read more »

How to build Flickr in Drupal

By Angie ByronArticle83 comments

Using the delightful combination of Image and Image Exact Sizes modules, two parts Views, and a dash of theming magic, you too can have your very own Flickr clone... in Drupal! This recipe will show you how! read more »

Drupal Actions and Workflow Video

By Jeff RobbinsVideo19 comments

This videocast shows how to use Drupal's Actions and Workflow modules to create a simple trigger to send out notices whenever new content is posted to your site. (8 1/2 Minutes - 10 MB H.264 MP4)

How to properly add CSS files

By Ted SerbinskiArticle11 comments

As I was working on cleaning up a few isses for the Javascript Tools module, I stumbled upon one issue dealing with overriding CSS styles. In this case, JSCalendar was adding it's styles after a theme's styles were being loaded. Obviously, from a CSS standpoint, it would be impossible for the theme to override and change CSS styles in JSCalendar. This needed to be fixed.

After some digging, I found this comment that explains this problem in more detail and outlines the correct procedure for modules and themes to add CSS files.

To summarize Tom:

<?php
// Modules should do:
drupal_set_html_head(theme('stylesheet_import', base_path() . drupal_get_path('module', 'mymodule') .'/mymodule.css'));
?>

<?php
// user-created PHP pages/blocks/comments/etc. should do:
theme_add_style('misc/local/my_custom_style.css');
// (theme_add_style is also used internally for the style.css files)
?>

<?php
// themes should do:
$output .= theme('stylesheet_import', base_path() . path_to_theme() . '/extra_stylesheet.css');
/* note that this should be BEFORE theme_get_styles, which will reference
  the style.css file and anything added by the user... themers will probably also
  want it located after drupal_get_html_head, which will bring in any module-specific CSS
*/
?>

Take control of your Drupal theme

By Matt WestgateArticle59 comments

Want to create a front page that's styled differently from the rest of your site? Perhaps you need a separate admin theme? Or how about a login page which only shows the login block and nothing else? With a little PHP knowledge these problems are easy to solve. read more »