Drupal

Drupal Random Image Block

I have a website devoted to Italian horror movie posters and I wanted a way to add a block in the righthand sidebar that would display random images.

There were a couple of problems with this. Just displaying a random image is not difficult using the image_get_random function but I wanted a way to specify galleries to use. I wanted to have one block that chose a random image from my giallo movie collection. I wanted a second block to pick movie images from two other photo galleries - either "Italian Horror Films" or "Other Italian Films".


Creating a Code Example Block for Drupal

I'm sure this is documented somewhere on http://www.drupal.org but I couldn't find it so I thought I'd document it here so I can remember what I did.

I was looking at a way to highlight code blocks, as well as output from both Unix screens and command line windows, inside of Drupal entries. This makes those sections stand out from the rest of the text of your article like so:

This is what the code block should look like