Blog

You should follow us on twitter or subscribe to our RSS feed if you want to stay on top of all the latest.

vosechu's picture

Recursively load nodes from a rich data model

If you've ever worked with a rich data model in drupal you know it can be a pain to load up all the children and parents of a node within the templating engine. One method that could save you a lot of time is to load the data recursively in node_load and save your poor front-end guy some wrist pain (or yourself if you're that guy!) Edit: Please look at the get_metadata() definition towards the bottom or none of this is going to make sense. Here is the initial bit which loads on details about a node. Here of course you could load all manner of things like read/write attributes, cck fields, etc. Read More…

bob's picture

Drupal and Fivestar, ajax style. A short case study.

So there we were, facing a Flash based video player that could have multiple tabs of many videos apiece. And we needed to have graphical user ratings that would be stored in the Drupal database and that looked just like fivestar on the user side. And we couldn't refresh the page when switching between videos. It just didn't look right. Luckily, the video player provider has a very verstile API and the player was firing Flash events that we could use to trigger actions. Out of this came an ajax/fivestar solution. This is what we did. 1. Create a module that facillitates capturing the individual video data as Drupal nodes. Read More…

koes's picture

Customizing views_cycle module for differently styled marquees

During the theming process for the Emmys, specifically Emmys.com and Emmys.tv, we were presented with 2 differently styled marquees. On Emmys.com, the pager uses an image, while on Emmys.tv, the pager uses number with a background image along with next/previous buttons. Read More…

dylan's picture

Quick Drupal Cacherouter and Boost benchmarks

In the discussion following my last post about cron and the cache hit rate, I promised to do some testing of the different cacherouter backends, as well as Boost. Again, these tests focus on the needs of a smallish site with 500 nodes and 1200 requests per day. Boost is the clear winner for response time (which shouldn't be a surprise given that it allows the web server to deliver HTML files directly from disk). Read More…

dylan's picture

More complete breadcrumbs for Ubercart checkout

By default, Ubercart sets the breadcrumb on the checkout page to simply "Home", which I personally find a bit odd. Because it calls drupal_set_breadcrumb() late in the request cycle, it's not even possible to create menu links for use by the menu_breadcrumb or menutrails modules. Stranger still, the cart settings page offers a "Custom cart breadcrumb" text and URL option, but it's hard-coded to use a single link instead of a trail of links. Here is a small snippet that will set the breadcrumbs to mimic the URL paths, for example: Home › Cart › Checkout Read More…

dylan's picture

How Drupal's cron is killing you in your sleep + a simple cache warmer

A lot of what's written about performance tuning for Drupal is focused on large sites, and benchmarking is often done by requesting the same page over and over in an attempt to maximize the number of requests per second (à la ab). Unfortunately, this differs from the real world in two key ways: Read More…

vosechu's picture

Allowing CCK to handle the weight of your form elements

Lately I've been working on a project to allow drupal to intelligently manage legacy data, to display, edit, and work with all aspects of the data as securely as possible. Naturally, it's difficult to say the least but I've learned a great deal. One of the things I thought was going to be a pain but ended up easy was managing where the fields appeared on a form. Yes, I could set the weights manually through the Forms API but CCK actually gives us some really great tools to do this without sweating. For reference, this is based on the wonderful if totally impossible to find article here: The Great Pretender. Read More…

dylan's picture

Repositioning node comments

A strange quirk in Drupal 6 hard-codes comment rendering into the node module. This makes it quite difficult to reposition comments, for instance under a set of tabs in the node template. Attempting this brings you crashing into the most dreaded rampart of Drupal theming; moving something out of it's vertical stack:comment_render($node) can easily be placed in your node template, but how on earth can the original display be removed? comment_render() is called by node_show(), which contains this nugget: if (function_exists('comment_render') && $node->comment) { $output .= comment_render($node, $cid); } Ouch. (Thankfully, this has been fixed in Drupal 7.) While it's tempting to fake it with jQuery, or CSS positioning, there is a way to fix this by overriding the page callback for node rendering. Here's a quick module that implements this solution: Read More…

sam's picture

Whitehouse.gov re-launches on Drupal

If you have ever spent any time around software development, (especially here in Portland with our amazing open-source community) you'll know that the community takes a great deal of interest in the success of others. With Drupal, I have rarely come across another technology that shares the same sense of nearly parental pride from members of the community. When yet another high-profile Drupal site launches, everyone shares in the excitement. Read More…

Pages