Drupal

A solution to "too many checkboxes"

Drupal's permission screen has loads of checkboxes. And if you've got lots of roles and you're using something like Forum Access, you'll find yourself clicking 'till the cows come home. Fortunately, there's an easy solution—CheckBoxer, a Google Chrome Extension.

Programmatically moving menu links from one menu to another

Here's a little snippet to move a menu link from one menu to another. For example, let's move the Contact Us link from the Primary Links menu to the Secondary Links menu. All you really need to know is the internal name of the menu where you want it to move to.

Exporting and creating field definitions in Drupal 7

I frequently export field definitions so I can programmatically create them in an update.php function. In Drupal 6, the CCK module came bundled with a Content Copy, but (so far) I have found no similar tool in Drupal 7. Here are the tricks I use to do this in a quick an relatively painless way.

Creating vocabularies and taxonomy terms programmatically in Drupal 7

Here's a little tip to create a vocabulary programmatically in Drupal 7.

taxonomy_vocabulary_save((object) array(
  'name' => 'Vocabulary Name',
  'machine_name' => 'vocab_short_name',
));

And, just in case you need to create a taxonomy term in your new vocabulary, you can do it with taxonomy_term_save. But first, we need to get the ID of the vocabulary we just created.

Creating a menu link programmatically

A friend of mine asked how to create a link programmatically in Drupal. I do this sort of stuff all the time, because one of the projects I help with requires us to write update scripts for our deployments. Let me outline two ways to do this, one via the Forms API, and the other using menu_link_save.

Beginner books on Drupal 7

One of my clients asked if there were any good beginner books on learning Drupal 7. Here are several I found... haven't read any of them yet, so I would recommend the one with the best reviews (as of this posting), which I'll post first.

Making Toolbar and Administration Menu co-exist in Drupal 7

The new Toolbar and Shortcut modules in Drupal 7 present a solution which most people had been solving with the Administration Menu module. They are great for non-admins who frequently need access to a handful of admin pages.

However, I can't shake the Administration Menu habit—all those nice drop-down menus make site administration a breeze. How do you enable all three modules without making your website look like a browser with two many plugins installed?

Not verified? What does that even mean?

Ever wonder why Drupal displays "not verified" next to the author name when somebody posts a comment on your site? Ever wondered what it even means? Does it bother you to think that your commenters might take it as a personal offense? "Hey, thanks for posting a comment on my site—you 'not verified' person, you!"

Enabling the email field for anonymous commenters in Drupal 7

Thanks to the excellent Mollom module, allowing anonymous comments on your website is a manageable task. No more spam, and all the benefits of anonymous commenting, such as the low-barrier to involvement.

However, in Drupal 7, there is one step you may have missed (I know I did). By default, the email and homepage fields on the comment form are disabled. To bring 'em back, you have to configure your comment settings, per content type, to either allow or require anonymous poster to leave their contact information.

Subscribe to RSS - Drupal