Drupal social publishing software

Drupal is a powerful content management system and framework that makes building powerful websites possible for mere mortals. Some of the posts here will be syndicated to Drupal planet.

OSCON, Drupal and the greener conference circuit

OSCON is nearly done. It has been a great week and a couple of great days at the Drupal booth on the Expo floor. Sometime I hope to get a little more written about the experience. For the moment I'm in the Greening the Conference Circuit sessionhttp://en.oreilly.com/oscon2008/public/schedule/detail/2910 where we're discussing many issues related to encouraging vendors to be more environmentally friendly. It is nice to see how many of the great ideas being discussed were implemented by the Drupal booth.

One of the best ideas relates to reducing the amount of unused, non-recyclable material in the conference bags. The suggestion in the room is that we should spend more time with conference vendors, who like Drupal, didn't produce materials in the bag and aren't handing out things at the booth that will be taken by many folks and used by few. Not having a handout has several positive effects first and foremost there isn't the waste, either in unused materials or in folks who casually pick things up but don't really ever look at it again. On the other hand at the Drupal booth we were often stacked six or eight Drupalers deep each talking to one or more interested people about Drupal. And more than a handout placed quickly in somebody's hand we could direct individuals to the best places to get information for their particular needs.

As with most conferences the really good bits have come in the hallways and in the meeting of great people. The sessions have largely been solid with a few outstanding sessions to punctuate the week.

Don't hack core and don't hack contrib (unless you have to)

If you spend much time in the Drupal community you'll hear the refrain don't hack core. But no matter how many times it might be said the temptation to hack core seems great. We've recently helped with several sites and there seems to be a common thread of problems caused by hacking core. These hacks are then costly to the client in the long run, often resulting in several hours (at best) of additional work to sort out what has been done and set things right.

My contractor says they need to hack core

So you've heard you shouldn't hack core and now you have a developer that is telling you they must do it to accomplish your goals. Please, Please, Please when you hear this do yourself a big favor and say no. If the contractor you're working with still says it's necessary then by all means get a second opinion. There are many, many, many, manyThis is the firm I started and own., reputable Drupal consulting firms who will help you figure out whether the hacks to core are really necessary.In addition to consulting firms there are a number of outlets like forums and local Drupal groups who would also likely have people willing to give you some suggestions The money you spend hiring one of these groups for a couple of hours will be well worth it in the long run.

Adding video to Drupal posts the simple and valid way

I've been on a bit of a video binge lately posting several videos from YouTube here. This can be done several ways, including using the code supplied by video sites such as YouTube. The problem for someone who wants to keep their HTML valid is that YouTube posts the video snippet using tags which aren't valid HTML. However, like it does for many things, Drupal provides an easy solution. The video filter module makes it easy to put a [ video:URL] style tag in a post and have the video embedded. And best of all it does so cleanly with valid

tags. It's worth noting there are several other modules like the embeded media field that can make the process work in other ways if one is developing CCK types and wants to include videos. So if you're looking for a solution that does even more be sure to check these out.

PBS Engage using Drupal

While working on some ideas for interactive media sites I came across PBS Engage which is a Drupal site working to engage viewers in the stories on PBS. Chapter 3's portfolio lists some of the cool things they worked on including a super-duper administrative interface for the backend of the site.

Inbox Zero.... schmero

The picture at the right, showing some 520 unread email messages comes courtesy of the combination of the import_node module, Organic Groups and a successful import.

Note to self and others: when you're importing a whole bunch of Organic Groups you might want to turn off email notifications before proceeding with the import.

Drupalcamp at CALIcon

If you're headed to the CALI conference on law school computing this summer be sure to check out Drupalfest. At Drupalfest a group of law school Drupalers will be taking the group through a one-day intensive Drupal setup and configuration. We'll start with a thumb-drive with the necessary applications pre-installed and leave with each person having a functioning student-organizations website.

So if you're headed to Baltimore and have always wanted to know more about this whole Drupal thing be sure to sign up and join us.

Using named anchors with #redirect in forms

Working on a site using the jstabs module this evening I came across a bit of a challenge passing named anchors to the #redirect element of a form. The desired url for redirection in this case was /user/myuser#profile-tab-7.

Asking in #drupal led to the following tidbit from chx. (This is one of the many reasons Drupal is wonderful since Google searching didn't produce results and my experiments and requests of friends didn't produce the answer.) Anyway the challenge is that #redirect causes the form to call drupal_form_redirect() which in turn calls drupal_goto(). The drupal_goto() function takes the path, query and fragment as it's first three arguments.

drupal_goto($path = '', $query = NULL, $fragment = NULL, $http_response_code = 302)

Drupal Camp PDX


Off to a great start at Drupal Camp PDX. Ben Kaplan and Andrew Morton are kicking off the day with what Drupal is and is not. Some great analogs are being used to illustrate what Drupal is and is not. Of course having a Drupal Camp in the beautiful Portland area makes it all the better.

A fun jquery trick

Working on the Forum Thread module I came across a bit of a challenge. On one user's site the call to add an inline javascript file (drupal_add_js()) was being called from nodeapi twice. Since it is calling inline javascript drupal_add_js happily puts the script on the page twice.

In this case the script in question calls a "toggle" function to hide and show the comments on a given forum node. Since the script was there twice it obediently displayed and then immediately hid the comment body. Evidently users aren't keen on this method of speed-reading.

The solution then is simple. Use an external .js file. However, in this case to make the module easy to configure I wanted to allow users the choice of which css element identifies a "comment title". (An aside that the way this works is to hide and show the siblings of the title which does impose some requirements about how the comment is formatted.) So this makes it more complex because I want to include the proper selector in the script and still include it in a file.

To accomplish this I ended up splitting the jQuery function into a couple of separate calls. The first, an inline script, does an addClass to the user-identified comment title class. Then a file-based javascript acts on the newly added class to hide and show the comments as a website user chooses on each page.

It is possible to see the results in action.

Boise Drupal user's group meeting

Being the first Thursday of the month the Boise Drupal User Group meeting at the Eagle Public Library. We took a look at several cool projects members of the group are working on. Included among them are these great Drupal modules:

  • Mark it up
  • SuperNav
  • Many cool projects that folks are working on but not ready to have the traffic yet

Having a thriving local Drupal User group is great. Now off to start on getting the pancakes ready for Saturday's pancake breakfast.

Pages

Subscribe to Joshua Brauer: All Drupal items Subscribe to Joshua Brauer: Drupal Planet only