DrupalDork.com was shut down on September 18, 2013. This is just a snapshot of the site as it appeared then.

Posts from January 2012

Follow-up: Local Settings Template

Quick follow-up on my post about local settings file template: colleague Ben Clark forked my gist and added all sorts of good stuff that I hadn't considered. Thanks Ben!

Category:

Local Settings Template

A couple months ago, I wrote about our strategy of using local settings files here at Jackson River.

I was setting up a new development site on my machine the other day, and realized that I've been consulting that blog post a couple times a week to copy over bits of code that were missing from various dev sites. It seemed like a good idea to move it into a gist:

And, since I use TextExpander as much as I can, I also made a snippet to grab the contents of this gist.

In order for this to work, make sure you set the Content dropdown above the snippet content to use Shell Script, like this:

TextExpander Shell Script selection

Now when I type "llocalsett", I get a mostly-ready local.settings.php to start with!

DOPE #2: Node Subpages

Today was my second Day of Personal Enrichment at Jackson River. DOPE days are sort of like Google's 20% time, where employees are encouraged to work on projects that interest them. We don't have the luxury of doing it one day a week, but we do spend a solid day on these projects when we can fit it in the schedule. I wrote about the first one back in May, when I did some work on the Simplenews Threaded Send module.

This time around, I spent the day upgrading the Node Subpages module for Drupal 7. I originally wrote this module for a client, and this past weekend I released a 6.x version (read the release announcement here). The short explanation is that this module allows admins to define subpages that should be available on every node of a given content type. These subpages can display either a text field from the node, or a View. This can be seen in action on the Drug Policy Alliance site: Issue nodes like that one have subpages such as Our Priorities, Resources, and Activist Toolkit. You can read more about the module functionality on the project page.

Thanks to the Coder Upgrade module, I had the basic functionality upgraded pretty quickly. The rest of the day was spent adding features and fixing little things that needed cleaning up. It now allows you to re-order subpages once they are created and displays all values for fields that allow multiple values (it was originally developed to display only the first value, since that was all we needed at the time). The re-ordering turned out to be a real pain in the butt. The documentation for drupal_add_tabledrag() wasn't real easy to follow, but I was able to figure it out by comparing my code to theme_filter_admin_format_filter_order().

7.x-1.0-alpha1 is now available on the project page. It's in alpha for now only because this version has only been run on my local dev environment, and I'd like to get a few more eyes on it before tagging a stable release. Give it a spin and let me know what you think!