Drupal
file_directory_path() doesn't exist in drupal 7 - except under certain conditions
I was just about to release the Drupal 7 version of Development Banner a few days ago, I got an error trying to install it on a local site during final testing:
Fatal error: Call to undefined function file_directory_path() in /var/www/html/sandbox/public/7.x/sites/all/modules/cowork/dev_banner/dev_banner.module on line 83
dev_banner comes to Drupal 7
I just released a Drupal 7 port of the Development Banner module. It was an illumiating experience, learning of some of the subtle changes required to go to D7. I'm liking 7 more and more, as a dig around under the hood with a source debugger. It is easier now to have a pretty complete separation between code and presentation, which has always been a kind of hold grail for web developers.
Special thanks to bocaj for his excellent suggestions and help with testing.
SWOC relaunched last week
I've been working on the SWOC site recently, creating some custom theming and redesigning some of the Drupal architecture. The site was originally created by MentorNet, and they hired designer Micah Kasman to create an exciting new look. It was a fun challenge to realize some of his design concepts in a new theme.
Electronovelty moves to Drupal 7
I've been following the progress of Drupal 7 for the last few years, doing an install every month or so and watching all the pieces come together. Since its official release, I've been itching to make a real live site with it, so I rewrote my business site, electronovelty.com, in D7. And you know what? I really like D7 and hope to do as much future work I can with it.
#drupalchi wrapup
I've been reflecting on Drupalcon11 - just when I though the events of previous years couldn't be topped, I was pleasantly surprised (but not too surprised) about what a trip this was! Congratulations to the Chicago User's Group for pulling off such a magnificant accomplishment. The idea of Chicago in early March wasn't too appealing at first, but having the convention in a great hotel made a big difference. I didn't have to ever leave if I didn't want to. The weather wasn't too bad, and the Loop was a ten minute walk away.
My Drupal development environment
Everybody has their own favorite tools and setup for Drupal development; here's the way I do it these days. Here is a list of considerations for choosing a development platform, tools, and a few tricks for deployment.
Drupal is a PHP-based framework for creating websites. It's primarily a content management system, but so much more. The beauty is how easy it is to intercept it at many levels and modify its behavior, via a system of "hooks" and presentation overrides. So to start, we'll need a good programmer's text editor for code. I find an interactive debugger to be the most efficient way to see how and where overrides are happening, and having it built into or accessible by the editor is a really big help.
Displaying drupal aggregation feed summaries in a block
I wanted to display a summary of recent items from a data feed in a block, using the titles as links to view the entire article. After evaluating different ways of grabbing feeds, I decided on the Aggregation module, because it offered most of the features I needed, with the least aggregation <g>. But it didn't have the block feature I wanted, so I built my own module to do so, called Aggregation Block.
It's pretty simple; there is an admin page that looks for any feeds you've added, and allows you to expose it as a block. You can add a custom title, and limit the number of items displayed. Nothing fancy, just does the job.
You can see it on my Electronovelty site, which I use it to pull in Drupal articles from Glatzland.
Building out a Drupal 6 site
A few tips for those starting out... there's a lot to do when building a new Drupal site! Here are some techniques I use, so I end up doing things in a consistent way.
Sorry if a lot of this is going to sound like mumbo-jumbo; I'm assuming you're familiar with some simple Unix commands, general development tools, and a bit about Drupal. If you see something you don't understand, a quick look on Drupal will probably clear it up for you. These are techniques I've found useful, but may not match your preferences, so feel free to adapt them to your likings. If you're new to Drupal, much of what I'm outlining is considered to be best practices (or at least pretty good ones), and I hope they will help you figure out some good deployment tools.
Building a local drupal development environment with multihosting
Ever wish you could work on coding a Drupal site without the hassle of the constant edit/ftp/test cycles? Or how about making changes when you have no Internet access available. Here are a few tricks many professional developers I know use; if you aren't aware of them yet, they could end up saving you a great deal of time and frustration. And it's always nice to be able to make some changes when inspiration strikes you, even when you're offline. Here's an approach I use with Drupal 6 sites.
The key is that Drupal is pretty much location agnostic; it is extremely easy to move a site from one hosting environment to another with just a few lines of code. Once you have a new environment configured, it will automatically use the correct configuration based on the URL.
Moving the secondary menu to a block in the drupal Fusion theme
I recently discovered the delights of the Fusion theme, comboed with the Skinrmodule. Very powerful and versatile, should make some theming tasks much easier. I tried creating a subtheme, which was pretty easy to do. One little issue, though; I'm using secondary menu links created as sublinks of the primary menu, and it is displayed at the top of the page. I wanted to move it to the left sidebar, but couldn't find a graceful way to move it to a block.
My solution was to create a tiny module to create the block. I prefer using code rather than adding a block that only lives in the database, since it will run faster and can be version controlled this way.
Here is a link to my Secondary menu block module. You can see the readme and download the code.
getting drush 3 to work with cygwin
Being one to avoid religious arguments, I tend to not get too upset by some of the hoops Windows can put me through - but I will admit that Unix-based development usually has fewer mysteries to it. I've got a Mac and a Linux server, so why do I put up with Windows at all? Short answer is that as a professional Drupal developer, I can't imagine life without the phpED IDE. Simple as that. I hadn't used an IDE for years, but fell in love with phpED after Peter Lindstrom walked me through it a few Drupalcons ago. I've tried Eclipse and some other debuggers, but nothing comes close for productivity for me.
But there's still that Windows part, and as masochistic as I am at some times, there's now way I'm going to working the cmd window. Fortunately, we have cygwin, a pretty decent Unix shell that runs under Windows and allows me to use Unix commands and familiar tools. I use it in conjunction with the LAMP stack Xampp to have a pretty nice local dev environment. However, it has one foot in each world, and took me a little work to figure out how to get drush to work with it.
drupal module of the day: vt_default
The Vertical Tabs Default Tab module is a great enhancement for the Vertical Tabs module. It does one little trick: allowing one to make the fields that aren't normally displayed in vertical tabs (title, body, etc.) into a new vertical tab. I find this makes the user interface for content entry much cleaner and less distracting. The entry fields are easier to focus on, and the form takes less vertical space.
Finally got around to updating my portfolio page
Like the cobblers children with wornout shoes, developers often neglect their personal sites. I finally brought my Electronovelty personal services site up to the latest module versions, rethemed it, and gave it a narrower focus. Reviewing my portfolio, I am reminded of the fun of creativity, along with the battle of keeping features from expanding out of control. Advice given to me decades ago still rings true: never let the client know how easy it is to change anything!
Favorite Drupal modules: addtoany
tweetme
Here's another wee little module that just creates a simple block; in this case, the "tweetme" block you see at the top of the left nav column on this site.
This is something I was asked to build for a friend, who wanted to have a way for folks to click on a link and get to his twitter profile page. I made it a little more general purpose; it has a settings page where you can specify your twitter handle, and the text to display to the left of it.


