Converting a Drupal Site to Straight HTML

Web Development:

When Bad Hosts (Yahoo Small Business) Happen to Good Drupal Sites

Time 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. Consider the facts:

Why is "Full HTML" Input Format Dangerous?

This is a comment I submitted on my localhost site, with full HTML allowed for anonymous users. The fact that "XSS" came up in an alert means I'm vulnerable to attack.

If you want your skin to crawl more, visit the XSS Cheatsheet, which offers a number of techniques for XSS attacks. If you're ever in doubt, no better test than to attempt to hack yourself.

YUI Editor: A Simple, Beautiful, and Easy Drupal WYSIWYG editor

Reviewed Version: yui_editor-6.x-2.0
Depends on: Yahoo YUI

VERDICT: Outstanding! The only lovable Drupal WYSIWYG editor . Painless Installation, Great First Impressions, Easy to configure, image Uploading/insertion works out of the box, editor behavior solid and intuitive, and offers good security features.

In our last review of WYSIWYG editors, a certain editor won because it met my low expectations. Thanks to the tip from Sanjeev, I found an editor so good its off the charts.

Painless Installation, Great First Impressions

The moment after I installed YUI Editor I found this refreshing WYSIWYG smiling at me.

makes you want to write

Wasilla Amateurs...

Another amateurish sign: Todd Palin's outsize role in the mess. Branchflower said it was out of his jurisdiction to pass judgment on the First Gentleman, but his report paints an extralegal role for Todd Palin that would have made the Hillary Clinton of 1992 blush. In the report, the head of Gov. Palin's security detail says that Todd spent about half of his time in the governor's office — not at a desk (he didn't have one), but at a long conference table on one side of the office, with his own phone to make and receive calls. It became a shadow office, the informal Department of Getting Mike Wooten Fired.

Time on Palin

Apple iWeb: Spawn of Satan; The Most Perverse Thing I have Ever Seen in My Firebug

I was doing a little SEO work for a friend. I thought the job would be simple enough... but that was before I knew of the iWeb. Even Dreamweaver, back in 2004's wysiwyg editor seems like a forward thinking, beacon of semantic markup compared to this monster.

But I'm getting ahead of myself... lets go back to why she had to pay me to do SEO work:

Drupal.behaviors: The Two Step Secret To Unlocking Drupal's Javascript

The hardest part about using drupal's javascript features is knowing where to begin: they remained an arcane mystery to me until today. After drinking a bit of whiskey, and studying how core was using Drupal.behavior, I learned it couldn't be simpler. If you don't know how to do this, take a moment:

Overriding Menu Page Callbacks

Sometimes you need to override more than a theme function: the entire page needs to be overridden. Drupal 6 makes it rather easy to do this.

In the example below, we call hook_menu_alter(&$callback) to override the display of every single node page view.

Instead of returning a node page, we return "[author's username] is great... for me to poop on.".

 

hook_theme and tpl.php files: registering them with drupal, and passing variables

There is one way to let drupal know about a theme function or template. There are two ways to send variables to a template, but one of them has a lot of disadvantages.

We'll use two theme functions, with an identical template setup to illustrate these methods:

Creating Theme Functions and Routing Them to a Template

There's only one way, hook_theme()

Loading a Menu, and Theming the Links in Two Lines of Code

When creating a menu [ admin/build/menu/add ] there's a field for "Menu name". We use that value to load whatever array of menu links we want. In this example, we're using "secondary-links" which comes default on most drupal installs.

Pages

Subscribe to Nick Lewis: The Blog RSS