drupal

Missing menu links

More than once I had all my menu links disappear. I would make a change in a block or in a theme's CSS files and suddenly all forms of links (menu links included) on every page would disappear. It turns-out I had made a typo.

Drupal for facebook fatal errors

In a Drupal based installation that uses FaceBook comments, I was getting "fatal errors" whenever I put the site down for maintenance and once when the ISP took the site down for scheduled maintenance itself.

Getting the URL of an attached image in Drupal7

If you are writting a module in Drupal7 you may run into problems getting the URL for a file attached. These two lines of code will do it:


$file=file_load($node->field_name["und"][0]['fid']);
$image_link = image_style_url( "thumbnail", $file->uri);

taxonomy flat lists

This is a real world example of using a series of flat taxonomy lists to categorize information. We'll be categorizing BMW car models and organizing them by car style and engine displacement. Since the car styles can get complex and car models can have more than one body style but we want don't want any cars listed more than once so we are going to use the flat lists I talked about. The other kind of lists go much deeper into Computer Science theory and data structures.

drop-down menus in the Drupal theme CTI-flex

The suckershish menus in CTI_flex are afflicted with a common problem in many suckerfish implementations. There is a small gap between the parental branch and the leaves. If the font is set larger than expected the dropdown will disappear when the user doesn't pause above the parent and moves the mouse down which can get frustrating.

Using drupal's taxonomy for navigation

"Taxonomy" in Drupal is the native way to categorize nodes. So what do you do with the nodes created? You can use it for navigation purposes. A link will get you all nodes with a specific taxonomy set and it can use some boolean logic (and, or or).

Turning Drupal maintenance mode on or off (site offline/online) with mySQL

If you are already on the Linux command line or inside phpMyAdmin when you need to take a site off-line for maintenance then you may prefer to simply enter the following than log into Drupal and manipulate the setup.
  • check if on or offline
    SELECT * FROM variable WHERE name='site_offline'

all pages on a Drupal web site won't display (page not found)

You migrate you database from a dump but all of a sudden no page is found. No matter what you do you get a 'no page is found'.

views and 5stars

In a Drupal6 installation, you want to use a user rating from 5stars in a View. This might be to sort a list by the highest rating first, limit a list to those above a certain rating, or to display the rating in a view.

This article assumes you are familiar with the inner workings of Views, 5stars, and have them both installed- including the 'Views UI' module.

There are two potential stumbling blocks here. You need to have the 5star ratings enabled for the content-type you are using, and you have to establish a 'relationship' in the views you are going to use.

IE limits

Sometimes a Drupal site will work fine when you use a browser other than Internet Explorer but be completely unformated in IE. It seems to be a problem with the way Drupal organizes Cascading Style Sheets and IE. The fix is usually simple.

It seems that Internet Explorer stops loading style sheets after about 31. I've read different numbers but they are all close to 31.

Syndicate content