Skip to main content

Drupal

warning: Creating default object from empty value in /var/www/venutip.com/public_html/modules/taxonomy/taxonomy.pages.inc on line 33.
Drupal stuff

Video Thumbnails with Media and YouTube or Vimeo in Drupal 7

File under

Today, one of the designers I work with asked me a pretty simple question about a Views-based list of videos. The listing displays thumbnails of videos being pulled from YouTube and Viemo. The question was: how do I change the size of the thumbnails?

It’s easy enough to change the size of images, but the process gets fairly confusing when it comes to other content types. Here’s a quick breakdown of the steps I took to enable video thumbnail resizing:

  1. Create an image style.
  2. Set the effect you want on the image style.
  3. Create a file style.

Mixing Context and Drupal's Native Block Ordering System

File under

I work on a lot of legacy sites that were built without the Context module, and I would say that at least once on each of these legacy sites, I turn to Context when I have a very specific problem: the visibility settings for a particular block are so complex that (in Drupal 6 at least) they can only be expressed by writing code. For instance: suppose you’re using Organic Groups, and you want to show or hide a block based on whether the user is a member of that group.

Removing Behaviors Using a GMap Macro

File under

I’m building some maps for a client using the GMap module and came across the following simple problem: using a GMap macro, how do you remove a default attribute?

The GMap module lets you set a number of default attributes for your maps: width, height, center position, initial zoom, and so on. If you want to change any of the default settings for a given map, you need to specify your overrides in a GMap macro, which looks something like this:

[gmap zoom=3| width=500px |height=350px]

Preventing Empty CCK-based Blocks from Printing

File under

Today I learned that if you have a Views-powered block that uses CCK fields; and the CCK fields are empty for all the returned rows; then Views doesn’t realize you’ve got an empty set and it still prints all the scaffolding for your block – the admin links, the container divs, and so on. The content of the block is empty, but the HTML still takes up space and throws off your layout.

Views and i18n

I just started working on my first multi-lingual site in Drupal this week (woo-hoo!), and ran into a minor issue with one of my views: both the English and Spanish versions of translated nodes were appearing in the view. No good!

Flickr Slideshow Support in Drupal Content Fields

File under

Just released a patch to the Video Filter module that adds support for embedding Flickr slideshows in content fields. It’s pretty flexible. Just browse to a set or its slieshow, copy the URL, and add it as you would any other media type in Video Filter:

[video:http://www.flickr.com/photos/some_user_name/sets/56109963647105794/]

So far it’s just for the 5.x branch, but if the patch is accepted and there’s interest, I’ll gladly port it to 6.x.

Getting a path to your subtheme

File under

Was working with a subtheme today and ran into a problem with theme_get_path(), which is supposed to return the path to the active theme (actually, it's slightly more complicated than that; the value you get back depends on the context in which you call it).

Unfortunately, theme_get_path() does not always work correctly for subthemes.

Assumptions and Errata: Two Quick Tips

First tip of the day: when reading any kind of technical book, one of the first things you should do is check the errata. This will save you time, hassle, and drywall repair costs.

Second tip of the day: don't assume. This is an infinitely more difficult tip to follow through on than the first, because most of the time, you don't even realize you're making an assumption.

Syndicate content