Skip to main content

Lullabot Podcast

Tartalom átvétel
Frissítve: 13 óra 25 perc

Module Monday: Pagepeeker

2012, január 30 - 20:00

Whether you're building a Delicious-style link archive or a personal portfolio site, Drupal's Link Field is a great solution for storing user-entered URLs as part of a node. If you want to display something more visual than a URL, however, things get tricky. Third-party thumbnail generation services can create screenshots of URLs, but most rely on clunky client-side scripts to layer the thumbnails on top of your design. The Pagepeeker module offers a slick alternative: it leverages an up-and-coming thumbnail service to generate site screenshots without any Javascript code.

Setting up the module is simple: create a Link field, then select the PagePeeker display formatter. You can choose from several thumbnail sizes, or pull in the 16x16 Favicon for the linked URL. If you're working with links that aren't stored in FieldAPI fields, the module also provides a helpful theme function. Just toss a URL at it, specify the size of thumbnail you want, and it will output a linked image tag.

Installing PHP PEAR and PECL extensions on MAMP for Mac OS X 10.7 (Lion)

2012, január 17 - 14:00

MAMP is an easy to install set of tools for that provides a great local development environment for Mac users (Mac Apache MySQL PHP). OS X does ship with its own built in versions of these tools, but MAMP adds lots of goodies. The newest version of MAMP includes a graphical configuration tool, a choice of PHP versions, web-based tools for administering your databases, and a variety of useful PHP extensions.

Unfortunately, MAMP doesn't include everything. If you're developing a site that needs additional PHP extensions like the Memcached library or exotic database drivers, you'll need to use the PEAR and PECL tools to build and install them. PECL (PHP Extension Community Library) and PEAR (PHP Extension and Application Repository) both provide access to a large pool of useful PHP add-ons, but using them with MAMP requires you to do a bit of extra configuration. In this article, you'll learn how to get them running on the latest version of MAMP (2.x).

Installing Components

The usual method for installing PEAR and PECL components is via the command line. Here is an example for installing PHPUnit.
$ pear channel-discover pear.phpunit.de
$ pear install phpunit/PHPUnit

Module Monday: Bundle Copy

2012, január 16 - 23:00

Back in the olden days of Drupal 5 and 6, the venerable CCK module came with a useful add-on: Content Copy. While it had rough edges, Content Copy allowed you to export a given content type and all of its custom fields into a snippet of PHP. The same module could be used to import that snippet of PHP code on another site and re-create the content type, with all of its settings and custom fields.

Sadly, that feature didn't make the cut when the CCK module became Drupal 7's built-in FieldAPI. While the Features modules has eclipsed Content Copy for serious site deployment, sometimes it would be handy to have the same easy "Export, save, and reuse later" option in Drupal 7. Enter Bundle Copy, the successor to Content Copy.

Like is ancestor, Bundle Copy is pretty straightforward: visit Content Types administration page and click the Export tab, then choose the content types you want to export. Pick the individual fields, submit the form, and voila -- a pile of PHP that can be saved to a text file, and re-imported to another site running Bundle Copy. The module also supports the new entity types that ship with Drupal 7: Users and Taxonomy Terms. If you've heavily customized user profiles with Drupal 7's FieldAPI, it's a quick and easy way to share the tweaks.

The Friday Roundup: Drupal 8, Performance, and Teeny Weeny Hard Drives

2012, január 13 - 22:00
Links Corralled by Lullabots CMI TMI? FYI.

Drupal 8's Core Initiatives have been humming along over the last few months, and the 'CMI' Configuration Management Initiative has posted its first major patch. If you're interested in keeping tabs on the bleeding edge future of Drupal, be sure to check it out. Previously, the Configuration Management Initiative scored a big win when support for UUIDs -- allowing simpler synchronization of data across sites -- was added to the development branch of Drupal 8.

Don't Be Evil

Kenyan Startup Mocality had a rude awakening this December, when the businesses they worked with reported confusion about the company's new joint venture with Google. The problem? There was no joint venture: a Google team was spidering Mocality's site, cold-calling businesses in its directory, and offering them a "special discount" on hosting services while pretending to be partners. Crafty analytics helped Mocality prove what was going on, and Google has apologized.

More Drupal Faster

Module Monday: Text Formatter

2012, január 9 - 16:00

CCK in Drupal 6 and FieldAPI in Drupal 7 give site builders a variety of structural and formatting options for carving out new content types. Multi-value fields in particular allow a node or other content element to store lists, collections of links to taxonomy terms, and more. The downside, of course, is the formatting: by default, Drupal's HTML output for multivalue text fields is a big old bag of DIVs. Taxonomy fare a bit better: they're output as proper HTML lists, a semantically proper approach. Both still require considerable CSS wrangling if you're interested in displaying multiple values simply, however. And that is where the Text Formatter module comes in.

Text Formatter is a simple CCK/FieldAPI formatter for Drupal 6 and 7 that outputs multi-value text and taxonomy fields as comma delimited lists, or customizable HTML lists. It can do a few other fancy formatting tricks, as well: the last item in a comma-delimited list can be preceded by a grammatically correct 'and', and comma-delimited lists can be closed with a period. Ordered and unordered lists can also be chosen, and a custom CSS class can be specified for a particular list if you're interested in targeting special CSS rules or JavaScript behaviors. The module even allows you to format single-value long text fields as lists if they contain multiple lines of text.

2011 and Onward

2012, január 5 - 14:57
Lullabot's Year In Review and Where We're Headed

January 1st of 2012 is the beginning of Lullabot's 7th year. When Matt Westgate and I launched the website and the company on the first day of 2006, we had no idea how successful we would become. Each year around this time, I find myself looking back with appreciation. I thought I'd take a few moments to sum up my thoughts about Lullabot's 2011 and where we're headed in the future.

Accomplishments

As we close out 2011, we have 30 people at Lullabot – most of whom are full-time employees – and we're still hiring. In 2011, we led the Drupal-based relaunch of MarthaStewart.com and WWE.com; we played a key role in the relaunch of Harvard.edu; we helped Sony Pictures move many of their sites to Drupal; we kept Grammy.com running through the 2011 awards night; we built The Grammys website for the 3rd year in a row (be sure to watch the CBS telecast on February 12th); and we worked on some super secret stuff that we're not allowed to talk about. Our Drupal video training site, Drupalize.Me continued to grow and bring Drupal knowledge and expertise to thousands of subscribers. We built iOS, Android, and Roku apps for Drupalize.Me to make it easier to access our huge training library. And we launched Videola, Drupalize.Me's underlying platform, as a separate Drupal distribution and hosted solution for enterprise video management and ecommerce.

Oh yeah, and we also ran our third Do It With Drupal conference, which hosted about 250 attendees in Brooklyn, NY in October. The 35-or-so sessions from DIWD, including keynotes by Jeffrey Zeldman and Josh Clark, are being posted weekly to Drupalize.Me.

A Quick Guide for Code Reviews

2012, január 4 - 18:00

Code reviews are an essential part of the software development process. Often a code review is considered to be a distinct process and kept separate from day-to-day development. At Lullabot, we consider code review to be a critical component of any development - just like QA, automated testing, and documentation. Code reviews are an acknowledgement that every developer is a human being, and humans make mistakes. No matter the skill or background of a developer, reviewing their code can only improve the final product.

Of course, code review is an integral part of Drupal development as well. The community convention is that at least two people (and often many more) should read and understand code for it to be considered for inclusion in Drupal. While contributed modules don't often have the resources for full code reviews of every patch, be sure that any module author would love reviews of their code.

What are the key components of a code review? While this is by no means a comprehensive list, here are some of the items I look for when reviewing code. Feel free to post your favourite code review tactics in the comments below.

The Story of the Code

All code committed to a project should be an atomic unit that describes:

  • Why the change was made.
  • What lines of code were changed, and how the new code works.
  • How to verify that the change actually worked.

Module Monday: Konami Code

2011, december 26 - 18:00

Here at Lullabot Headquarters, we try to make sure that each week's Module Monday article highlights a lesser-known tool that's simple, useful, and efficient. In honor of the holiday season, though, this week will show off a Drupal module that's 100% fun: Konami Code!

If you played video games in the 80s, you might remember the infamous secret code that could be entered on the first screen of Contra and other games produced by Konami. An entire generation of gamers learned that up-up-down-down-left-right-left-right-b-a was the key to eternal life, and more recently the code was the key to activating east eggs on web sites like Facebook.com and Marvel.com. Now, thanks to the Konami Code module, you can hide the easter egg of your choice on any Drupal site using the same key combination.

Module Monday: Slidebox

2011, december 19 - 16:00

Keeping visitors to your site reading and clicking (and -- let's be honest, viewing ads) once they've finished an article can be challenging. Often, lists of related articles or hot news are embedded at the end of each article to provide readers with an easy "next step," but these can easily be lost in the noise of a dense footer or link-heavy site. Enter Slidebox, a svelte module that uses interesting jQuery tricks to prompt users who've finished an article with a smoothly animated link to another one.

Setting up Slidebox is a snap: just turn it on, tell it what node types its "Next article" box should appear on, and you're ready to go. While it's possible to tweak the values that control how long the Slidebox animations should take, the defaults it ships with are sensible. The magic happens once you pop open a node and scroll to the bottom of its content: a tidy little box slides out from the right side of the window, prompting you with the title of the "Next Article." It's simple, attractive, and easy to dismiss. Also, because it appears when the user scrolls to the end of the node content, not the bottom of the page, it doesn't require that readers wade deep into a crowded site's footer or other "below the fold" content to see the link.

Module Monday: Premium Content

2011, december 12 - 18:00

Drupal's node access system provides a basic framework for hiding nodes from unprivileged users, and a bevy of third-party modules us it to restrict access based on content type, group membership, and more. Sometimes, though, you don't want to hide content entirely. If you're teasing visitors with a glimpse of premium content, you don't want nodes to be completely hidden. What you need is the Premium Content module.

Based on the venerable Premium module for Drupal 4.7 and 5.0, Premium Content leaves node teasers untouched, ensuring that content shows up as normal on listing pages. When a user who doesn't have permission to view premium content visits the node's full page, however, they get a message prompting them to register or upgrade their account.

Premium Content ships with automatic support for two common "premium scenarios." Archival mode leaves all nodes publicly visible when they're created, but automatically marks them as premium once they're two weeks old. "Embargo" mode keeps content premium when it's posted, but releases it to the public after two weeks. Administrators can customize the time periods for those automatic changes, or switch to manual mode, allowing authors to designate individual nodes as premium when they're created.

Building the Android App for DrupalCamp NYC 10

2011, december 9 - 23:34

DrupalCamp NYC 10 is on Saturday, and while preparing for my session, I've spent a decent amount of time working on the free Android app for the conference.

This is my first experience with Android, and I'll be talking more about how this app was built with Treehouse's Roger López at our Building mobile apps with Drupal, DrupalCampNYC Mobile Apps How-to session. (There are still some rough edges, so please be kind!)

If you're going to DrupalCamp NYC, be sure to download and try out my app (it's FREE) -- I'd like to hear your feedback!

Module Monday: Absolute Messages

2011, december 5 - 20:00

Drupal's assorted status and warning messages give users and administrators important information about what's happening on a site. They're a bit dull, though, and can easily blend in with the rest of a site's content. In addition,while most Drupal features provide copious hooks for developers to tweak, there's no simple way to hide some messages and show others, alter the text of a given message, and so on.

Absolute Messages fixes that, layering some snappy display options onto Drupal's normal message system and giving developers a set of convenient hooks to manipulate messages while before they're displayed.

The most visible change once you've installed Absolute Messages is the appearance of Drupal's system messages. They appear at the top of the screen, in color-coded boxes with their own 'Dismiss This Message' close boxes. The style is modeled after the popular Stack Overflow site, and it duplicates some of the site's behaviors as well. Long messages can be collapsed to just a few lines, expanding when the user mouses over them, and normal status messages can automatically close themselves after a few seconds.

Behind the scenes, these rules can be configured for each type of message -- Status, Warning, and Error -- ensuring that important notices don't go away while a user isn't looking.

And the Nominees Are...

2011, december 2 - 17:45
Lullabot Powers the Grammys for the Third Year Running

The web was buzzing with news of The Grammy nominations and performances on Wednesday night, and Lullabot's work ensured that the latest information was available as it happened.

This was Lullabot's third year doing the nominees special, and we racked up some impressive numbers: the site peaked at serving 2,621 requests/second, and it served up pages to 275,000 unique visitors over the course of just three hours.

However, the big night when the winners are announced is coming up on February 12, 2012. Last year we had 3,346,000 unique visitors during that show, and we're expecting at least that many this time around. We're working hard to prepare the site for this major traffic, so be sure to tune in to The Grammys in February, and check out the the site anytime!

Organic Groups for Drupal 7

2011, november 30 - 18:29

Organic Groups (OG) for Drupal 6 is a powerful and widely used module for creating websites that enable group collaboration or to create 'mini sites' within a bigger Drupal site. The Drupal 7 version of Organic Groups is a total rewrite, taking advantage of many new Drupal 7 features, in particular the new APIs for entities and fields.

One of the big differences between the Drupal 6 and Drupal 7 versions is an expansion of the concept of what a 'group' is. In D6, a group is a node, and other nodes can be assigned to it as the content of the group. In D7, any type of entity can be a group and any type of entity can belong to a group.

In this article we'll take a high level look at the new architecture of an Organic Groups group, and walk through the steps to build a basic group in Drupal 7.

Module Monday: Views Quicksand

2011, november 28 - 23:00

One of the biggest selling points for Drupal is the ease with which cool web design tricks can be integrated into existing sites once they're available as reusable modules. The jQuery Quicksand plugin, for example, gives site visitors a fluid, easy-to-understand way of sorting and filtering the items on a page. Wiring it up to work with your Drupal site, though, used to require some heavy duty theming tweaks to make your site's markup match what Quicksand expected. Now, easy integration is available via the Views Quicksand module: just install it, set up your view,

Sadly, screenshots don't do the Quicksand plugin justice: it displays the items on your page in a simple grid, and when the filter or sort options you've selected change, the items drift into new positions, vanish in a puff, or re-appear depending on the new filters. As demonstrated by this Quicksand demo page, it's especially impressive when the content you're displaying uses similar images like screenshots or thumbnails.

Views Quicksand integrates that fluid reshuffling effect with Views' native support for AJAX-powered sorting and filtering. Change the Views sort options, and items smoothlyreflow into their new positions.

Module Monday: Views Nodes Split

2011, november 21 - 21:00
Questionable pluralization, awesome feature.

It's a simple request with a complicated solution: how can you display a list of nodes such that the first one is displayed in full, while the rest are displayed as teasers? For years, it's been possible to do that with the Views module by craftily combining two views: one for the first node, another for the remaining ones. While that approach gets points for craftiness, it's cumbersome and forces you to maintain two separate View displays. Thankfully, the newly-released Views Nodes Split module has made the trick simple.

Setting up the module is simple: just turn it on, and build your View as you normally would. Then, click on the View's Format option and select the newly available "Splited Content" row style. While the grammar is awkward, the results are great: you can specify separate build modes and display styles for the first node and all subsequent nodes from a simple config screen. In fact, you can even adjust where the cutoff happens: you might want the first three nodes to display in full, for example. No other changes are needed for your View; this module's new row style handles the rest.

DrupalCon Denver Session Update

2011, november 17 - 22:34

The DrupalCon Denver committee has posted a list of the sessions that will definitely be on the docket next spring in Denver.

The sessions on this list represent 80% of the sessions for DrupalCon. The other proposals are still in consideration and the final cut among them will be announced in January.

As you can see by that list, DrupalCon Denver is shaping up nicely, with a wide variety of interesting presentations on dozens of topics that should be timely and important to anyone using or building Drupal sites. Have you signed up for DrupalCon yet? Register today!

Ten of the confirmed sessions are led, or co-led, by the Lullabot team. The current list of Lullabot sessions is:

Localized and Multi-Lingual Content in Drupal 7

2011, november 17 - 19:30
The new (and old) translation systems, and how they work

The way that Drupal manages translations has been evolving over several versions of Drupal. It has always been somewhat daunting to figure out how to set up a multilingual site in Drupal, and it requires a combination of core and contributed modules to make it work well. In Drupal 7 we have some great new features, but we also ended up with two different systems of managing content translation, so there are also lots of new questions and options. If you're new to Drupal's multilingual system, or new to Drupal 7, you'll have lots of questions about how to get this working well.

To make this whole process easier we'll cover the following in this article:

  • Understanding the difference between interface and content translation
  • Discuss the two alternative systems for content translation in Drupal 7 and how they differ
  • Walk through the installation and set up of a D7 multilingual site
  • Provide an extensive list of modules, articles, and resources that may be helpful

Module Monday: Custom Contextual Links

2011, november 14 - 19:00

With Drupal 7's contextual menus, it's easy to pull up edit forms and other management screens for specific entities like nodes, comments, and views. Just mouse over the entity in a list, and you'll get a dropdown menu of contextual options. Adding your own custom links to an entity's context menus, however, can't be done out-of-the-box. Custom Contextual Links changes that; it allows you to add any link to the context drop-down for supported entity types!

Setting up Custom Contextual Links is easy. The module adds its own screen to the administrative configuration section. Adding a new link gives you a set of simple options to control the link's title, destination URL, and where it should appear. For now, it supports adding links to specific blocks, all blocks, specific nodes, specific node types, and all nodes simultaneously. It's a little detail, but the module's administration UI does a good job of hiding unnecessary options using Drupal 7's new States API.

Module Monday: Panelizer

2011, november 7 - 15:00

When it comes to designing customized layouts and complex content-rich pages, few Drupal modules can match the flexibility of Panels. It shatters Drupal's traditional "Region/Content/Blocks" divide, giving site managers the ability to build custom layouts and enforce consistency across different types of pages.

Unfortunately, the "variations" system that Panels and its companion module Page Manager use can be cumbersome; developers and advanced site builders can master it, but managing huge numbers of different layouts can be a pain. This is particularly noticeable when each individual node on a site, or even of a particular content type, needs to have its own special layout or mix of page content. Wouldn't it be great if there were some way to give some editors and content creators control over the Panel layouts for just the nodes they create? That's exactly what the Panelizer module does.