Skip to main content

Theme_menu_links: How to target a specific menu in Drupal

Today we needed to override the menu links of one menu on our Drupal 7 site. We started with theme_menu_links(), but quickly decided that we didn't want to figure out what menu every menu link belonged to. After some searching we discovered this comment (https://api.drupal.org/comment/26939#comment-26939) which suggested using this naming structure:

THEMENAME_menu_link__MENU_NAME()


AWS - IAM Permissions - Setup permissions for one user to access only one S3 bucket

While using Amazon's AWS system, we needed to give access to one S3 bucket. Todo so, we ended up using Amazon's IAM. Once we created the user in the AWS system, we created the following policy to allow this new user to only be able to read/write to their bucket:


Drupal functions I can't live without anymore

Below is a list of Drupal functions that I can no longer live without, but for some reason I have trouble remembering them. So, here is a list of functions that I use regularly.

Drupal 7

drupal_clean_css_identifier - http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_cl…
Use this function to sanitize css identifiers.

Check back as I'll continue updating this list.


Getting a themed views title within a style tpl file

I ran into an issue today where I needed to get a themed views title from within a views row style template file (tpl). I tried using drupal_get_title() and menu_get_item() but the title elements were all blank for these. Next I inspected the $views object looking for the themed title but it was not listed. Finally, I discovered within $views->build_info the title and substitutions variables.


Migrating Drupal 6 'sites/default/files' directory to 'sites/sitename.com/files'

Just wanted to post these instructions for my own sanity, and so I wouldn't lose them as I've used them numerous times over the past year. Thanks Jeff for the original post:

http://www.midwesternmac.com/blogs/geerlingguy/moving-your-drupal-files…