User login

Drupal World - Tutorials Get our RSS feed for this content

Stay up-to-date with news on Drupal from around the net.
The Drupal World part of DrupalSN is a selection of the best Drupal feeds from around the web hand picked so you can get all your Drupal News in one place!
27
Monday, October 27, 2008

Multi-Column CSS Layouts for Slackers

You don't need a crazy CSS framework to make multi-column CSS layouts easy. They already *are* easy.If you feel skeptical about my claim, I don't blame you.
19
Sunday, October 19, 2008

Converting a Drupal Site to Straight HTML

When Bad Hosts (Yahoo Small Business) Happen to Good Drupal SitesTime and again, I work for a client who is stuck with a horrid server environment -- say -- Yahoo Small Business.* Surely you must think that a company like Yahoo -- who employs none other than Rasmus Lerdorf -- would offer a decent environment. That's where you'd be wrong.Its so bad that Drupal 6 won't even allow itself to ATTEMPT an installation. And with good reason.
28
Friday, March 28, 2008

Drupal 6 AHAH forms: The easy way

Today, I was working with drupal 6's AHAH form elements. Initially, I was delighted at how well they worked. That delight turned to confusion once I realized that the form elements I had put in the menu callback of the #ahah['path'] was missing its name attribute. After doing a bit of research in how the poll module handled the formapi voodoo, I created a generalized function to aid in building AHAH callbacks. If there is a better way to do this, I wasn't able to find it.read more
13
Thursday, March 13, 2008

Drupal CSS Coding Standards

On the #drupal IRC channel, Excallibur points out that there are no coding standards for CSS. I'd like to propose some straightforward ones. Note that I am not intentionally omitting indentation within rules, but am having trouble with my code filter. I. CSS is not Java.This java-style of CSS does not make the code easier to read: #rule1{ margin:0px;}It just adds an unnecessary space. Below is the correct way, which is consistent with core CSS. #rule1 { margin:0px; padding:1em;}II.
20
Wednesday, February 20, 2008

Stupid Simple Web Scraping with SimpleXML

The other day, I was tasked with building a data scraper. Having never built such a contraption, I naturally turned to the Internets for preexisting code. I was horrified with what I found. The “free” PHP scripts (that’s “free” as in “free baby vomit”) were all infested with the worst sorts of newfangled regex, and PHP 4 era DOM traversing.
18
Friday, January 18, 2008

Enabling/Installing New Modules via Update.php: The Complete Solution

In our last episode of enabling new modules via update.php, Steve McKenzie pointed me to a better method: module_enable(). A quick test found, however, that it didn't run the install files, and didn't rebuild the module files cache. So after spending 5 minutes in system.module, I found all the missing pieces. The example update function below will install and enable the new module, as well as rebuild all the css, node type, and menu caches.
18
Friday, January 18, 2008

Enabling/Installing New Modules via Update.php: The Complete Solution

In our last episode of enabling new modules via update.php, Steve McKenzie pointed me to a better method: module_enable(). A quick test found, however, that it didn't run the install files, and didn't rebuild the module files cache. So after spending 5 minutes in system.module, I found all the missing pieces. The example update function below will install and enable the new module, as well as rebuild all the css, node type, and menu caches.
16
Wednesday, January 16, 2008

Enabling New Modules Via Update.php

UPDATE: There's a better way.I work with 3 other developers, all of whom have their own local sandbox of our site. Since we're constantly adding new modules, I found a simple way to enable a new module via another module's .install file. That way, all we have to do is run update.php when we update our source tree.Here's a simple example update function:<?
16
Wednesday, January 16, 2008

Enabling New Modules Via Update.php

UPDATE: There's a better way.I work with 3 other developers, all of whom have their own local sandbox of our site. Since we're constantly adding new modules, I found a simple way to enable a new module via another module's .install file. That way, all we have to do is run update.php when we update our source tree.Here's a simple example update function:<?
5
Wednesday, December 5, 2007

Drupal trick: Returning a themed menu tree with nothing more than the system path

I remember something a long time teacher said, "Nick, if you make a suit out of a gorrilla, the arms are too long." I forgot why that was relevent to the topic of theming menu trees.Moving on, here's a nice little function I wrote to return a themed menu tree by path.read more
13
Tuesday, November 13, 2007

7 jQuery Plugins That Made Our Lives Easier at ON Networks

We, the developers of ON Networks released version 1.1 of our website this evening (its built off of drupal of course... if it weren't, than I would go sharing it with the planet, would i?
28
Tuesday, August 28, 2007

The Key to Jquery Form Plugin + Drupal Formapi

Today I bring you an incomplete, yet stunningly easy solution to a problem that's been making want to set buildings on fire. This problem was making drupal comments go AJAX by way of jquery's form plugin. I had all the good makings of a digg clone comment system, with reply forms dynamically inserting under replies (instead of going to another page). It was just the sans-pagerefresh comment submit thing that was missing.
14
Saturday, April 14, 2007

Let Template.php Eat Static

 My arch-nemisis is overly complex logic in template.php and page.tpl.php files. It seems to me that when a drupal codebase becomes brittle and unmaintainable, the culprit is usually going to be hundreds of conditional lines of php code in a template file. You've probably seen code like this before: THEMES/SPAGETTI_MONSTER/TEMPLATE.PHP<?
14
Saturday, April 14, 2007

Let Template.php Eat Static

 My arch-nemisis is overly complex logic in template.php and page.tpl.php files. It seems to me that when a drupal codebase becomes brittle and unmaintainable, the culprit is usually going to be hundreds of conditional lines of php code in a template file. You've probably seen code like this before: THEMES/SPAGETTI_MONSTER/TEMPLATE.PHP<?
9
Friday, March 9, 2007

Going Global in Drupal: Too good to be true?

There is a timeless law that every serious blogger needs to remember. As this law doesn't seem to have a name yet, I'm naming it Gillmor's law , after Dan Gillmor. Roughly stated, the law is: "Your readers know more than you do." I've discovered a solution to a common drupal programing problem: how to avoid excessively running something along the lines of "$node = node_load(arg(1));" in hooks or functions that don't have node data available to them.