Tag: Drupal

How-to: Create Drupal development sites in Quickstart

Yesterday, I felt like reviewing some patches, so I fired up my Quickstart-based virtual machine and set about creating some Drupal development sites. I realized I first had to create Drush Make files to get the proper development versions installed. So I did that. However, I also realized that, despite cloning the code via Git and checking out a particular branch, the Git clone was not actually a Git repository. This is because Drush Make requires the –working-copy switch in order to do this. I’ve posted a workaround on the Quickstart issue queues. This post mostly serves as pointers to a couple things:

Feeds CSV Importer Sources: Caveat Amplificator

I had an interesting experience with Feeds and Feeds Tamper today. I wasn’t able to get a comma-separated set of words to turn into multiple tags no matter what I tried. I was using the Explode plugin that comes with Feeds Tamper and set the delimiter as a comma and the limit to 1. My research indicated this should work, but it didn’t.

There were two problems that were so counterintuitive, the urge to blog about them came over me. Disclaimer: I admit I’ve never properly read the Feeds documentation; I figured setting up a node importer based off a CSV parser would be pretty easy.

The solution is extremely simple:

When setting up your CSV importer and specifying Source column names, do not use spaces or uppercase letters. This means you need to avoid it in your CSV file as well.

That’s all! Instead of Body Text, call it body_text. What happens is that by the time Feeds Tamper receives your Feeds field, the data structure it uses to store them contains lowercase (and probably space-free) versions of whatever you had as the Source column names back in your updater. Using my tip ensures that these will be the same, and Feeds Tamper will be happy.

Have fun tampering.

P.S. The Latin in the title hopefully means, “Developer beware.”

Meetup API Tools Seek Co-Maintainer, Further Developments Possible

Always wanted to entitle something like that. Anyway, I’m certainly not getting anywhere fast on PHP Meetup API Client or Meetup API on drupal.org.

There are issues on both expressing this. Reply to them or contact me.

Meetup API on drupal.org issue: http://drupal.org/node/1194532
GitHub issue: https://github.com/wizonesolutions/meetup_api/issues/4

Code Sprint Report: San Diego, Conference Organizing Distribution (COD)

On May 7, I attended a code sprint in San Diego. Fortunately, Jerad Bitner has already blogged about this. Given that, I’ll share my experience and impressions rather than the event breakdown.

My previous code sprint was at SANDCamp 2011. That one was different in that the goals were planned out in advance and most of the time was spent writing code. In contrast, most of the time in this first COD sprint was spent planning, tweaking make files, and re-building feature modules. Porting an installation profile is a bigger job than writing a module, that’s for sure!

I mostly worked on researching the state of COD’s dependencies and updating the make file and groups.drupal.org wiki page accordingly.

The sprint was fun, and I’d do it again. It’s even better that the sprint helped move it forward.

I’ll be sprinting again at DrupalCon London, so look for me!

DTLA Re-Gifting

A neat thing about raffle prizes at Drupal meetups is the community aspect. Sometimes you win a prize for which you have no use and can give it back for use at another meetup.

This happened to me a couple months ago at the Downtown L.A. Drupal meetup. I won some online design-related training that I couldn’t use. I passed it on, and I suppose someone at the LA Drupal meetup received it.

Challenge Accepted (or: Migrating Site to Drupal 7)

If you’ve viewed source on my site or followed me on Twitter, you’ve noticed something strange: I’m a Drupal Developer, but my site runs WordPress. What the heck!?

A certain tweeter also implied that this site would be too hard to do in Drupal.

Well, paying respect to the old Wild West…them’s fightin’ words!

First, the backstory: This site was set up before I specialized in Drupal. Once I specialized in Drupal, I got too busy to convert it! Until now.

I don’t want any more tweets like that, so I’m aiming to convert it before or during DrupalCon London.

Stay tuned for updates!

Drupal Camp Sacramento Area 2011 Conference Report

This weekend, I attended the first DrupalCamp in the Sacramento, California area. It happened to be held in Davis, a location which worked for me.

Some of you might know that I was talking about taking Amtrak’s Coast Starlight up to the Bay Area. I indeed did. Here’s some pictures: (flickr link coming soon; I have to upload the pictures).

But as for the camp itself, it’s best to break it down into the sessions I attended and then give my overall impressions.

Day 1

As every attendee certainly did, I started off my day listening to Nate Haug (@quicksketch)’s keynote speech. He talked about the community, contributing, contributing productively, collaboration, and the care shown to community members. It was a good start. After that, I went to my first session.

10-11:30: VoIP for Drupal: Turning Drupal into a phone system

The title of this presentation had intrigued me, and I’m glad I checked it out. Adam Kalsey (@akalsey) of Tropo did a fantastic job of demonstrating the VoIP module and how command sets could be sent to phone systems using PHP code.

1:00-2:30 – Using Drupal as an Application Development Platform

This was a neat presentation as well. It was also presented by Adam Kalsey. His thesis was essentially that Drupal is an application development platform that ships with a great CMS as its default implementation. He defended this fairly, outlining many of the subsystems that I indeed deal with regularly.

2:30-4:00 – Building a Distribution using Features, Drush Make, Installation Profiles, and more

Ben Shell gave a fascinating presentation on the topic above. I found this very useful, as it cleared up some questions I had regarding the whole thing. I liked how he spoke a bit about how to get drupal.org to fully package your distribution or installation profile for download!

4:00-5:30 – Streamline your workflow with Fill PDF – fill your PDF templates with your site’s forms

Some dude who came from L.A. gave this one. I think his name was Kevin Kaland or something. Of course it was awesome; would I say otherwise? Fortunately, you don’t have to listen to me; Doug R. Wu has given a brief “str8up” account of the talk. That coupon code expires Monday, by the way.

Day 2

Morning-12 – Code sprint

Saturday ran late for some reason, and I got lost on the way back to campus, so I rolled in around 11 AM. I discovered that no organized code sprint was happening, so I worked more on adding Webform token support to Fill PDF on Drupal 7. This is completed now.

1:00-2:30 – Why Drupal uses hooks, and why you should too

I bumped into that Kevin Kaland guy again at this talk. Something about hooks in Drupal. People liked it or something. (If you blogged about this talk, can you link to it in the comments?)

2:30-4:00 – Know Where The Fire Is (Monitoring Drupal Sites)

I wrapped up my camp with Mike Hathaway’s Nagios talk. It was cool; Nagios is definitely a tool l will have to try some time, along with the Drupal Nagios module of course!

Conclusion

So ended my camp, and so began my transportational journey back…with a new sticker on my laptop!

Code Snippet – Open Link in New Window in Drupal 7

Although this is not recommended, I’ve seen the question mentioned in the topic come up a couple times over the last few weeks:

How do I get my links to open in a new window or tab in the user’s browser in Drupal 7?

I’ve heard that the target=”_blank” method is once again valid in HTML 5…however, it will still make your HTML fail validation under other specifications. The way around this is to use JavaScript.

Copy and paste this snippet into the appropriate area of your site – usually a JavaScript file in your theme. When you want to make a link open in a new window or tab, instead of target=_blank, add rel=”external”.

(function ($) {
Drupal.behaviors.externalLink = {
attach: function (context, settings) {
$('a[rel="external"]', context).attr("target", "_blank");
}
}
}(jQuery));

The reason this workaround is OK to use is that it does a little something called separating presentation from behavior. In other words, you aren’t relying on the browser to take a particular action because of the HTML itself; you’re telling it what action to take in the JavaScript.

Presentation on hooks goes primetime!

Just chiming in to express excitement about my presentation on hooks in Drupal (Why Drupal uses hooks, and why you should too) got scheduled for the largest room in the venue! Looks like I’d better be doubly prepared.

Thanks again goes to Oliver Seldman for inviting me to co-present this with him originally and for all the help with the slides and content, especially the simplicity of the presentation. Please give him your money.