Ben's blog

Is TypePad Regressing at SEO?

It would appear that way, but that article was written a few days before this one, so maybe they just heard their brother-in-law talking about meta tags?

Having trouble targeting page titles with CSS when using Views?

Sometimes, in a Drupal-based site, I want to do something to a certain title with CSS, which is easy if the title is on a node. But what if the title is on a View? Well, I’ve used this simple snippet with success to give the title of the Views page a unique id, allowing you to target it with CSS.

In the page.tpl.php file of your theme, find the area of code where your title is set. Insert the following code above.

<?php 
 $illegal = array("'", ",", " ", "-", "/", "&", ":", ";", "|", "–", "—");
 $uniquetitleid = 'title-'.strtolower(str_replace($illegal, "", $title));
?>

Then, replace the following code (or similar):

<?php 
if ($title): print '<h1 class="'. ($tabs ? ' with-tabs' : '') .'">'. $title .'</h1>'; endif; 
?>

with this:

<?php 
if ($title): print '<h1 id="'.$uniquetitleid.'" class="'. ($tabs ? ' with-tabs' : '') .'">'. $title .'</h1>'; endif; 
?>

This code simply takes the title of the page, strips some characters, converts it to lowercase, and turns it into the unique id for the <h1> element that contains the title. Obviously, this code won’t be very helpful if your title is based on arguments – unless you are wanting to make certain argument-based titles look different for some reason. Let me know what you think.

Media Temple vs Mosso vs Dreamhost Speed Test

Update 3/24/2009: As Chad mentions in the comments below, the comparison here is not really fair. We’ve been building some really high-traffic sites lately, and any virtual server will hit their limits under enough load. In other words, what’s the use of having The Fastest Server in Town if it crashes when it gets super-duper-boy-band-popular?

Update 3/24/2009: Because Mosso is missing some features that we desperately need for an upcoming job, we have been forced to leave them. I wasn’t happy about this, because their service is excellent, and the speed was great. We moved to a Dedicated-Virtual 3.5 - Base plan at Media Temple. For half the price, we get less disk space, and I was thinking it would be a bit slower. I was wrong. I’ve updated the chart below to reflect Media Temple’s speed test results for the same site.

This week was a bad one to be hosting with Dreamhost. I didn’t do any real tests to count downtime, but sites were slow and even inaccessible many times throughout the week. Sometimes, these fits would only last 10 minutes, but when you host ~30 sites on the same account, you will be notified if a site is down or painfully slow.

Let me make this clear: I know that Dreamhost is a value host, and it does give a great value for the money. They basically offer no limits on anything for $10/mo. That’s crazy cheap. Therefore, I wouldn’t expect them to offer the same speed or the reliability of a $100/mo host such as Mosso. This comparison is simply to share our site load time change when I switched one very large and demanding site from Dreamhost to Mosso.

(The site I tested is a Drupal site with caching turned off. (I tested it both ways on Dreamhost, but I can’t test Mosso with caching until it builds up a bit. I’ll post those results here as well.) The site is very heavy on images, and moderately heavy on CSS and Javascript. Nothing was changed on the site between the switch. The total page load size was 408.4 KB. Load time was checked using Pingdom Tools. I tested each host 5 times and these are the averages.)

Dreamhost Load Time
16.4 seconds
Mosso Load Time
7.97 seconds
Media Temple Load Time
5.9 seconds

As you can see, Mosso Media Temple loads the site in roughly less than half the time as Dreamhost. For 10X 5X the cost, I’ll take it. As a web developer, I must be able to depend on our host. Obviously, this test only shows speed improvement, but I am speculating that downtime will also be greatly reduced (Update: Now, the downtime is only a result of the configuration of LAMP, which is frustrating as well).

Have you had a similar or not-so-similar experience? Leave a comment below.

DrupalCon Day 1

Today was my first day at a DrupalCon and I had a great time. Some of the highlights: getting seriously schooled by Dmitri Gaskin, Dries telling us about Drupal progress, and discovering Calais.

Tomorrow should be fun. I’m looking forward to the subjects of scaling and sharing data.

Need paintless dent repair in Atlanta? Listen, I know this guy.

So, we recently completed a small site for paintless dent repair expert, Mr. Wayne Hicks. His situation was pretty common. He needed an online presence, but the content wouldn’t be changing regularly. He wanted users to be able to fill out a simple form to request a free estimate. No problem. He also wanted to show up in local business listings on search engines. Again, no problem.

The project went off without a hitch. No problem.

Paintless Dent Repair in Atlanta, GA – paintlessrepair.net

Paintless-Repair-website-by-ENGINE-Industries.jpg

AddToAny

Share/Save