Phone: + (702) 966.5500
Fax: + (702) 993.6900

Drupal 6

I find that during the course of building a Drupal site, oftentimes I find myself wishing that I had created more descriptive field names. As in, why was this field named field_blah when field_foo makes the purpose so, so much clearer. It's something of a cosmetic issue, to be sure, but also one that has to do with basic professionalism and organization - trying to make a site as clean and optimal as possible.

There are a variety of approaches to doing this. There is even a Drupal module: http://drupal.org/project/cck_field_rename ... which I tried out and it broke the database. Oh, well, that's why one should always make a backup before doing ANYTHING with one's data.

So, what do I think is the best way to do it? Well, just create a new CCK field with the name you want, move the data over with a MySQL query.

If the columns are in the same table (i.e. you're just changing the name and not the field type) it's as easy as:

UPDATE yourTable SET newColumnName = oldColumnName

If they aren't it would be more like this:

UPDATE newTable LEFT JOIN oldTable ON newTable.nid = oldTable.nid SET newTable.newTableColumn = oldTable.oldTableColumn

Voilà, painless... takes about 30 seconds including all the logins.

Just add this to your CSS file (which should be somewhere in a subfolder of /sites/all/themes/yourTheme/)

#node-form .tips, .tips + a, .tips + p {
        display:none;
}

ul.tips {
        display:none;
}

Throughout the ages, man and pondered many things. Among them, how to bulk update data based on a content type in Drupal. At long last, we have an answer:

UPDATE yourColumn LEFT JOIN node ON node.nid = yourColumn.nid SET yourColumn = 'yourData'  WHERE node.type = 'yourContentType'

Here you are doing a few things: You're telling MySQL to update the table you want to update. Then you're telling it to make sure that the NID (NODE ID - Drupal's unique node identifier) column you want to update is that same as the NID in the node table, the place where Drupal stores the content type information about the node, matches up ok. It then tells MySQL to put your data in there when the NID matches and the content type is the one you want.

May God bless you!

Drupal is a powerful CMS and does a lot of wonderful things. However, just because the folks behind Drupal are genius coders or system architects doesn't mean they know the first thing about SEO. In fact, there are so many SEO issues with Drupal that they almost merit their own section.

In this installment, we're going to discuss a MAJOR flaw in the robots.txt file in Drupal 6 up to 6.19. What was it?? It was this little line:

Disallow: /sites/

While innocent looking enough, this little line in your robots.txt file is a real traffic killer.

Since the Drupal core and most modules (and especially anything and everything that has to do with CCK) store all your images, PDFs, etc, in the /sites/default/files folder, what this line does is prohibit search engines from accessing this important content. This means no PDFs, docs, or spreadsheets in the search results, no images in Google Images, and so on. If you have a site that depends heavily on this variety content, this little line could be the difference between a successful site and a complete and utter failure.

Since everyone's site is different in terms of what they may want to allow and disallow, I don't have any specific advise about other than to consider every folder individually. Here's an example of our robots.txt for guidance.

Clients

Resources

Media