Tag: drupal 7

Drupal 7: Watch for hyphens in CTools and Panels plugin names

I recently ran into an interesting problem with the way CTools plugin methods are discovered (namely, CTools content types, used by the Panels ecosystem) in Drupal 7.

The project I was working on had various content types named things like piwik-tracking-code (not the exact name, but good enough to illustrate the issue).

Panels looks for various methods, such as settings and render methods, by taking the machine name of the plugin (typically the filename) and adding suffixes to it—a lot like hooks, in fact.

You might be able to see where I’m going with this if you’re familiar with PHP. That’s right: piwik-tracking-code_render() is not a valid function name! Therefore, it fails.

There are a couple ways around this. With some of the plugin functions, you can specify the function names in the definition or in one of the functions. If you must hyphenate, you have to do this.

The other way, of course, is to simply use underscores. This is what I did and what I would recommend.

wiz1.us – Custom Drupal 7 URL Shortener!

I just launched my own URL shortener for internal use. I am using a fork of the ShURLy Drupal module that runs under Drupal 7. It’s working well so far! I’ll write more about this soon, but just wanted to get it out there. Check out my first link at http://wiz1.us/m

Why Hooks? DTLA (Downtown Los Angeles) Drupal Joint Presentation with Oliver Seldman

A week ago, I presented with Oliver Seldman at the Downtown Drupal meetup in L.A. It was a presentation to get people’s feet wet on using hooks. We kept it as simple as possible, demonstrated an example, and took some questions.

Here’s the presentation:

(If you want to view just the slides, they’re here: https://docs.google.com/present/view?id=dcn4t95t_7skrhhfcx. Naturally, they contain a link back to this blog entry. Take care, and don’t recurse infinitely.)

I was planning to keep this short and sweet and say that I’d expand it later, but, umm, actually, this is about it!

You can access the Use Hooks code on this Drupal.org sandbox: http://drupal.org/sandbox/wizonesolutions/1083160. It has some bonus code examples not seen in the presentation! So go git clone it and look!

I also created a Drupal 7 version. See the BRANCHES.txt file for details.

Won my first prize at February Drupal meetup in Downtown L.A.

I almost forgot to post about this! I finally won the free raffle at this month’s Drupal meetup in DTLA. For my prize, I chose Chris Shattuck’s BuildaModule.com DVD promising me that I would Become awesome.™

I have yet to crack it open, but it goes without saying that I am excited that I’ll soon be awesome.

My First L.A. Drupal Presentation – Coder Upgrade and Drupal 7 Gotchas

Update (18-Feb-2011): I’ve added corrections (errata) for the talk at the bottom of the post.

A couple nights ago was a pretty exciting “first” for me. I gave a presentation at the Downtown L.A. Drupal Drupal meetup in Downtown L.A. You may remember me posting about my first lightning talk(s) a few weeks ago. This was my first longer presentation. Granted, 17:25 is not that long, but it certainly is long-er.

Without further ado, here is the presentation:

Now providing IRC support! Solved a couple problems already

So, since about 3 days ago, I’ve started providing some support on IRC! Basically, ever since Four Kitchens presented on open-source and no-cost tools for collaboration and mentioned that serious Drupal professionals needed to be on IRC, I decided I’d leave ChatZilla on and hang around on IRC. This led to me starting to answer people’s Drupal questions, and before I knew it, I was suddenly giving support!

It’s actually been quite a good experience. I’ve helped a few people solve their problems. Best of all, I was able able to check the, “I give support on IRC” checkbox in my Drupal.org profile!

Without further ado, let’s look at what giving support on IRC is like!

Drupal 7 Tips: Fixing “$ is not an object” in JavaScript code

(I almost named this, “Drupal 7 wants you to use $ for money, not your jQuery.)

I ran into an API change issue yesterday when working on upgrading Fill PDF to be fully Drupal 7-compatible, and just today, someone on IRC ran into the same issue. She suggested that “somebody” write a blog post about it, so I thought I would. I hope it saves some random Internet searcher a few hairs.

Basically, you can no longer use jQuery’s shortcut variable $ in Drupal 7 instead of the full jQuery variable.