Drupal case study on how this site was created

This site is not very complex, but I thought some people might find it helpful if I shared a few tips and tricks about how a few key features of it were created. Please also see the sub-pages listed at the bottom of this page, for exported copies of my Media CCK type, and the View for my Music page.

Theme of the site

The theme of this site is based on top of the Marinelli theme, and is adjusted in a few simple ways with just CSS, in order to customize the colors, header image, and typography. You can of course modify your copy of the Marinelli theme with these colors, though I'd appreciate it if you do use a different image in your header (the source image is from stock.xchng though is modified the way I wanted it to look). Feel free to copy any CSS in the source of my site.

Home page

The home page of the site is created using one of my preferred Drupal home page creation techniques, called Creating a home page using CCK. I created a single "Home" node and wrote some welcome text in the Body. To theme this page, I simply saved a copy of the Marinelli theme's node.tpl.php file as node-home.tpl.php, and for the content area of the template, replaced it with the following:

<div class="content">

<div id="home-main">
  <?php print $content?>
</div>

<div id="home-sidebar">
  <?php print theme('blocks', 'home_sidebar'); ?>
</div>

</div>

This simply displays the Body text which I wrote into a single "home" CCK node, and also includes a Views-generated block that I created for showcasing a list of the most recent projects. At Administer > Site configuration > Site information (admin/settings/site-information), I set the path for my home page to the path of my "home" node (e.g. either the path alias I used, home, or the original path of my home node, node/98). For a similar technique, see the video Custom Drupal Homepages.

The Views-generated "Recent Projects" block is included in a custom "Home sidebar" region which I added to the marinelli.info file of the theme:

regions[home_sidebar] = Home sidebar

A note of interest: the <?php print theme('blocks', 'home_sidebar'); ?> code as seen in the above template is how you can embed a custom region "within" the content area (in a node-content_type.tpl.php file, rather than just in a page.tpl.php file where regions usually are). You can then assign as many blocks as you want to this region from admin/build/block.

Music page

The Music page of my site displays a slideshow of audio and video files of my latest music projects. Each of these media files is uploaded to its own "Media" node. The media functionality for this page is powered by the SWF Tools module (there's a great video guide to using SWF Tools available). No video processing is done on the server in this case (rather, I convert my videos into Flash .flv format before uploading them using a program called VisualHub).

If you prefer to host your video on an 3rd party video site, you can simply use the Embedded Media Field module instead of SWF Tools. Here's a great video which explains how to use Embedded Media Field.

The Media content type also uses a separate Imagefield to upload a pre-selected frame of the video (images are stored at a path of media-image), and is using the JW Player 4, the Stylish custom skin using color settings in SWF Tools, and a background image behind the player in CSS to simulate rounded edges for the player. The slideshow is powered by the Views Carousel module. The order of the media is determined by each node's position in a Nodequeue (though if you are content to sort by the submission date or other criteria, then Nodequeue is unnecessary). Feel free to use Firebug to look at my CSS, which you are free to copy and use.

In my Media content type theme, I have removed the original $content variable and replaced it with separate variables to individually call up each field of the content type, which gives me much more control over each field. Here's a lesson on how to theme content types with this level of extra control.

Here is my node-media.tpl.php template:

<div class="node<?php if ($sticky) { print " sticky"; } ?><?php if (!$status) { print " node-unpublished"; } ?>">
   
<div class="content">

<div id="media-content">

  <div id="media-description">

    <h2><?php print $title?></h2>

    <?php print $node->field_media_description[0]['view'] ?>

    <div id="media-copyright">
      Music &copy; <?php print $node->field_media_date[0]['view'] ?> <?php print $node->field_media_owner[0]['view'] ?>
    </div>

  </div><!-- /#media-description -->

  <div id="media-player">
    <?php
   
// Displays the media player with an Imagefield preview and the Play icon turned off
     
print swf($node->field_media[0]['filepath'], array(
       
'flashvars' => array(
         
'image' => 'media-image/' . ($node->field_media_image[0]['filename']),
         
'icons' => 'false')
       ));
   
?>

     
    <?php
   
// Displays the music-only message if checked for this node
     
$musiconly = $node->field_media_musiconly[0]['view'];
      if (
$musiconly == 'musiconly') {
        print
'<div class="music-only">Music only, video not available</div>';      
      }
   
?>

  </div><!-- /#media-player -->

</div><!-- /#media-content -->

    <?php if (!$teaser): ?>
    <?php if ($links) { ?><div class="links"><?php print $links?></div><?php }; ?>
    <?php endif; ?>
   
    <?php if ($teaser): ?>
    <?php if ($links) { ?><div class="linksteaser"><div class="links"><?php print $links?></div></div><?php }; ?>
    <?php endif; ?>

</div><!-- /.content -->
</div><!-- /.node -->

Modules used

Settings and icons for BUEditor

My favorite "code assistant" editor for Drupal is BUEditor. It's a simple no-nonsense editor which isn't a WYSIWYG editor like TinyMCE or FCKeditor, but rather a helper tool that provides buttons to quickly insert HTML tags. It comes with sensible basic formatting tags (which for most sites is all that you need) and gives you the ability to create additional buttons quite easily for other tags you want to use (you can create button graphics for your custom buttons, or simply use plain text which it makes look like a button). While editing content with BUEditor, you can highlight your text, click the desired button, and the correct HTML will be wrapped around that text. As an added bonus, it also includes a quick Preview button, which when clicked, instantly overlays a rendered preview of the HTML. Another click returns to the standard code view.

BUEditor replacement icons

New BUEditor icons

BUEditor's "default look" is a bit rough around the edges, so I've adjusted a few things as seen in the image above (both better icons, as well as some CSS tweaks). I extracted nicer-looking icons from TinyMCE (and made one or two myself) and saved them with the same names as the original BUEditor icons (which makes them an easy drop-in replacement). The buttons are available for download in a file called editor-icons.zip at the bottom of this page.

To get the icons to work, the best way is to upload the editor-icons folder to a location on your server, usually either as a sub-directory in your files directory, or a sub-directory inside of your theme. In my case I uploaded them to /sites/all/themes/mytheme/images/editor-icons.

Though it will technically work, you should "not" overwrite the default icons inside of BUEditor's module folder. If you do this, then you will have to remember to re-copy them every time you upgrade the BUEditor module in the future. Instead, BUEditor gives you a setting to allow you to use alternate icons instead of the default ones. Go to BUEditor's settings page at Administer > Site configuration > BUEditor (admin/settings/bueditor), click "Edit" next to the default profile (or a custom one if you've created one). Expand the "Editor paths" fieldset and set the Directory of editor icons option to the path for your custom icons. It offers some placeholders instead of directly typing the full path, but in my case only the %FILES one works. To put the icons in your theme folder, enter the full path and ignore the placeholders.

Import custom buttons and settings into BUEditor

At the BUEditor settings page, you can import a full set of buttons from a .csv file. You can import my .csv file attached to the bottom of this page, or add in the following buttons/code manually.

Image alignment / floats

This code replaces the code for Insert/edit image, and adds a select box where you can choose a CSS class to align the image either Left or Right (using a float). The related CSS you need to save in your style.css file is below in the next section of the page about CSS:

php:
$imce_url = function_exists('imce_menu') && user_access('access imce') ? url('imce/browse') : '';

return "js:
var B = eDefBrowseButton('$imce_url', 'attr_src', 'Browse', 'image');
var form = [
{name: 'src', title: 'Image URL', suffix: B},
{name: 'width', title: 'Width x Height', suffix: ' x ', getnext: true, attributes: {size: 3}},
{name: 'height', attributes: {size: 3}},
{name: 'alt', title: 'Alternative text'},
{name: 'class', title: 'Position', type: 'select', options: {'': '', img_left: 'Left', img_right: 'Right'}}
];
eDefTagDialog('img', form, 'Insert/edit image', 'OK');
";

New list items

This should be added as a new button. It wraps any selected text in a <li> to make it easier to add additional list items. Add LI as the Caption that will appear on the button:

<li>%TEXT%</li>

Code filter tags

If you use the code filter on your site, add this new button (due to the code tags "in" the button, I am displaying it in plain text here):

<code>%TEXT%</code>

Lightbox

If you'd like to add the ability to link to a Lightbox version of the image, add the following code in place of the Insert/edit link button's code. It's not as automated as could be desired, but for now this is the only way I'm aware of to do this with BUEditor & IMCE. This will create an option to choose "lightbox" when making a link, which adds rel="lightbox" to the link (which is picked up automatically by Lightbox 2 module). Click the Browse button to select the large version of the image you want to link to in the Lightbox:

php:
$imce_url = function_exists('imce_access') && imce_access() ? url('imce') : '';

return "js:
var B = eDefBrowseButton('$imce_url', 'attr_href', 'Browse', 'link');
var form = [
{name: 'href', title: 'Link URL', suffix: B},
{name: 'html', title: 'Link text'},
{name: 'title', title: 'Link title'},
{name: 'rel', title: 'Lightbox', type: 'select', options: {'': '', lightbox: 'lightbox'}}
];
eDefTagDialog('a', form, 'Insert/edit link', 'OK');
";

BUEditor style sheet tweaks

Add this CSS into your theme's style.css file to smooth out a few things with BUEditor's textarea, icon group spacing, presentation of the Headings menu, and to add float left/right support for images inserted with IMCE:

/**
* BUEditor styling for Comment/Node body forms
*/

#node-form .editor-container .separator,
#comment-form .editor-container .separator {
  padding: 0 4px 0 5px;
}

.editor-popup ul.chooser li {
  background-image: none;
  list-style-type: none;
  list-style-image: none;
}

.editor-popup h1,
.editor-popup h2,
.editor-popup h3,
.editor-popup h4 {
  margin: 0 0 5px 0;
}

.resizable-textarea textarea {
  border: 1px solid #D9D9D9;
  font: 1em/1.4em "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
  padding: 8px 12px;
  margin: 4px 0 0 0;
}

.resizable-textarea .preview {
  padding: 8px 12px;
}

/* IMCE Image floating */
.img_left {
  float: left;
  padding: 0 10px 10px 0;
}

.img_right {
  float: right;
  padding: 0 0 10px 10px;
}

Don't forget: add HTML tags to the "Filtered HTML" input format

By default, Drupal is very restrictive about which HTML tags to allow, and any tags that are not allowed will not display on the page (though Drupal won't delete them - they still exist when you Edit the page). Any HTML tags you want to permit, need to be manually added to the list. I've written a short article about this: Understanding Input Formats.

AttachmentSize
editor-icons.zip6.58 KB
bueditor_buttons.csv2.26 KB

CCK import code for the Media content type

This is an export of my full Media CCK type. Once you have ensured that you have installed and enabled every necessary module (particularly: CCK, FileField, Imagefield, Imagecache, Link, Date), you can import this CCK type into your site, using the Import option on the main CCK page (admin/content/types).

If the Export and Import options are not displayed here, ensure that you have enabled the CCK sub-module "Content Copy" first.

$content[type]  = array (
  'name' => 'Media',
  'type' => 'media',
  'description' => '',
  'title_label' => 'Title',
  'body_label' => '',
  'min_word_count' => '0',
  'help' => '',
  'node_options' =>
  array (
    'status' => true,
    'promote' => false,
    'sticky' => false,
    'revision' => false,
  ),
  'upload' => '0',
  'old_type' => 'media',
  'orig_type' => '',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'comment' => '0',
  'comment_default_mode' => '4',
  'comment_default_order' => '1',
  'comment_default_per_page' => '50',
  'comment_controls' => '3',
  'comment_anonymous' => '0',
  'comment_subject_field' => '1',
  'comment_preview' => '1',
  'comment_form_location' => '0',
);
$content[fields]  = array (
  0 =>
  array (
    'label' => 'Media file',
    'field_name' => 'field_media',
    'type' => 'filefield',
    'widget_type' => 'filefield_widget',
    'change' => 'Change basic information',
    'weight' => '-4',
    'file_extensions' => 'mp3 m4a aif aiff wav ogg flv swf mov avi mp4 dv wmv wma',
    'file_path' => 'media',
    'max_filesize_per_file' => '',
    'max_filesize_per_node' => '',
    'description' => '',
    'group' => false,
    'required' => 1,
    'multiple' => '0',
    'list_default' => '0',
    'force_list_default' => '0',
    'show_description' => '0',
    'op' => 'Save field settings',
    'module' => 'filefield',
    'widget_module' => 'filefield',
    'columns' =>
    array (
      'fid' =>
      array (
        'type' => 'int',
        'not null' => false,
      ),
      'list' =>
      array (
        'type' => 'int',
        'size' => 'tiny',
        'not null' => false,
      ),
      'data' =>
      array (
        'type' => 'text',
        'serialize' => true,
      ),
    ),
    'display_settings' =>
    array (
      'weight' => '-4',
      'parent' => '',
      'label' =>
      array (
        'format' => 'hidden',
      ),
      'teaser' =>
      array (
        'format' => 'hidden',
        'exclude' => 1,
      ),
      'full' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      2 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      3 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  1 =>
  array (
    'label' => 'Media image',
    'field_name' => 'field_media_image',
    'type' => 'image',
    'widget_type' => 'imagefield_widget',
    'change' => 'Change basic information',
    'weight' => '-3',
    'file_extensions' => 'jpg jpeg png gif',
    'file_path' => 'media-image',
    'max_filesize_per_file' => '',
    'max_filesize_per_node' => '',
    'max_resolution' => 0,
    'min_resolution' => 0,
    'custom_alt' => 0,
    'alt' => '',
    'custom_title' => 0,
    'title' => '',
    'description' => '',
    'group' => false,
    'required' => 0,
    'multiple' => '0',
    'list_default' => '0',
    'force_list_default' => '1',
    'show_description' => '0',
    'op' => 'Save field settings',
    'module' => 'imagefield',
    'widget_module' => 'imagefield',
    'columns' =>
    array (
      'fid' =>
      array (
        'type' => 'int',
        'not null' => false,
      ),
      'list' =>
      array (
        'type' => 'int',
        'size' => 'tiny',
        'not null' => false,
      ),
      'data' =>
      array (
        'type' => 'text',
        'serialize' => true,
      ),
    ),
    'display_settings' =>
    array (
      'weight' => '-3',
      'parent' => '',
      'label' =>
      array (
        'format' => 'hidden',
      ),
      'teaser' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      2 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      3 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  2 =>
  array (
    'label' => 'Description',
    'field_name' => 'field_media_description',
    'type' => 'text',
    'widget_type' => 'text_textarea',
    'change' => 'Change basic information',
    'weight' => '-2',
    'rows' => '5',
    'size' => 60,
    'description' => '',
    'default_value' =>
    array (
      0 =>
      array (
        'value' => '',
        '_error_element' => 'default_value_widget][field_media_description][0][value',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' =>
    array (
      'field_media_description' =>
      array (
        0 =>
        array (
          'value' => '',
          '_error_element' => 'default_value_widget][field_media_description][0][value',
          'format' => 1,
        ),
      ),
    ),
    'group' => false,
    'required' => 1,
    'multiple' => '0',
    'text_processing' => '1',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'op' => 'Save field settings',
    'module' => 'text',
    'widget_module' => 'text',
    'columns' =>
    array (
      'value' =>
      array (
        'type' => 'text',
        'size' => 'big',
        'not null' => false,
        'sortable' => true,
      ),
      'format' =>
      array (
        'type' => 'int',
        'unsigned' => true,
        'not null' => false,
      ),
    ),
    'display_settings' =>
    array (
      'weight' => '-1',
      'parent' => '',
      'label' =>
      array (
        'format' => 'hidden',
      ),
      'teaser' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      2 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      3 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  3 =>
  array (
    'label' => 'Media link',
    'field_name' => 'field_media_link',
    'type' => 'link',
    'widget_type' => 'link',
    'change' => 'Change basic information',
    'weight' => 0,
    'description' => '',
    'default_value' =>
    array (
      0 =>
      array (
        'title' => '',
        'url' => '',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' =>
    array (
      'field_media_link' =>
      array (
        0 =>
        array (
          'title' => '',
          'url' => '',
        ),
      ),
    ),
    'group' => false,
    'required' => 0,
    'multiple' => '0',
    'url' => 0,
    'title' => 'required',
    'title_value' => '',
    'enable_tokens' => 0,
    'display' =>
    array (
      'url_cutoff' => '80',
    ),
    'attributes' =>
    array (
      'target' => 'default',
      'rel' => 'nofollow',
      'class' => '',
    ),
    'op' => 'Save field settings',
    'module' => 'link',
    'widget_module' => 'link',
    'columns' =>
    array (
      'url' =>
      array (
        'type' => 'varchar',
        'length' => 255,
        'not null' => false,
        'sortable' => true,
      ),
      'title' =>
      array (
        'type' => 'varchar',
        'length' => 255,
        'not null' => false,
        'sortable' => true,
      ),
      'attributes' =>
      array (
        'type' => 'text',
        'size' => 'medium',
        'not null' => false,
      ),
    ),
    'display_settings' =>
    array (
      'weight' => 0,
      'parent' => '',
      'label' =>
      array (
        'format' => 'hidden',
      ),
      'teaser' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      2 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      3 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  4 =>
  array (
    'label' => 'Date of creation/copyright',
    'field_name' => 'field_media_date',
    'type' => 'date',
    'widget_type' => 'date_text',
    'change' => 'Change basic information',
    'weight' => '1',
    'default_value' => 'blank',
    'default_value_code' => '',
    'default_value2' => 'same',
    'default_value_code2' => '',
    'input_format' => 'd/m/Y - g:i:sa',
    'input_format_custom' => '',
    'advanced' =>
    array (
      'label_position' => 'above',
      'text_parts' =>
      array (
        'year' => 0,
        'month' => 0,
        'day' => 0,
        'hour' => 0,
        'minute' => 0,
        'second' => 0,
      ),
    ),
    'increment' => 1,
    'year_range' => '-3:+3',
    'label_position' => 'above',
    'text_parts' =>
    array (
    ),
    'description' => '',
    'group' => false,
    'required' => 1,
    'multiple' => '0',
    'repeat' => 0,
    'todate' => '',
    'granularity' =>
    array (
      'year' => 'year',
    ),
    'output_format_date' => 'd.m.Y',
    'output_format_custom' => '',
    'output_format_date_long' => 'd.m.Y',
    'output_format_custom_long' => '',
    'output_format_date_medium' => 'd.m.Y',
    'output_format_custom_medium' => '',
    'output_format_date_short' => 'd.m.Y',
    'output_format_custom_short' => '',
    'tz_handling' => 'none',
    'timezone_db' => 'UTC',
    'op' => 'Save field settings',
    'module' => 'date',
    'widget_module' => 'date',
    'columns' =>
    array (
      'value' =>
      array (
        'type' => 'varchar',
        'length' => 20,
        'not null' => false,
        'sortable' => true,
      ),
    ),
    'display_settings' =>
    array (
      'weight' => '1',
      'parent' => '',
      'label' =>
      array (
        'format' => 'hidden',
      ),
      'teaser' =>
      array (
        'format' => 'hidden',
        'exclude' => 0,
      ),
      'full' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      2 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      3 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  5 =>
  array (
    'label' => 'Copyright owner',
    'field_name' => 'field_media_owner',
    'type' => 'text',
    'widget_type' => 'text_textfield',
    'change' => 'Change basic information',
    'weight' => '2',
    'rows' => 5,
    'size' => '60',
    'description' => '',
    'default_value' =>
    array (
      0 =>
      array (
        'value' => 'David Newkerk',
        '_error_element' => 'default_value_widget][field_media_owner][0][value',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' =>
    array (
      'field_media_owner' =>
      array (
        0 =>
        array (
          'value' => 'David Newkerk',
          '_error_element' => 'default_value_widget][field_media_owner][0][value',
        ),
      ),
    ),
    'group' => false,
    'required' => 0,
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'op' => 'Save field settings',
    'module' => 'text',
    'widget_module' => 'text',
    'columns' =>
    array (
      'value' =>
      array (
        'type' => 'text',
        'size' => 'big',
        'not null' => false,
        'sortable' => true,
      ),
    ),
    'display_settings' =>
    array (
      'label' =>
      array (
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      2 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      3 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
  6 =>
  array (
    'label' => 'Music only',
    'field_name' => 'field_media_musiconly',
    'type' => 'text',
    'widget_type' => 'optionwidgets_onoff',
    'change' => 'Change basic information',
    'weight' => '3',
    'description' => '',
    'default_value' =>
    array (
      0 =>
      array (
        'value' => 'musicandvideo',
      ),
    ),
    'default_value_php' => '',
    'default_value_widget' =>
    array (
      'field_media_musiconly' =>
      array (
        'value' => false,
      ),
    ),
    'group' => false,
    'required' => 0,
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => 'musicandvideo
musiconly',
    'allowed_values_php' => '',
    'op' => 'Save field settings',
    'module' => 'text',
    'widget_module' => 'optionwidgets',
    'columns' =>
    array (
      'value' =>
      array (
        'type' => 'text',
        'size' => 'big',
        'not null' => false,
        'sortable' => true,
      ),
    ),
    'display_settings' =>
    array (
      'label' =>
      array (
        'format' => 'above',
        'exclude' => 0,
      ),
      'teaser' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'full' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      4 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      2 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      3 =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
      'token' =>
      array (
        'format' => 'default',
        'exclude' => 0,
      ),
    ),
  ),
);
$content[extra]  = array (
  'title' => '-5',
  'menu' => '4',
  'taxonomy' => '-1',
);

Views import code for the Music page and Recent Projects block

The following is code which you can import into Views 2 (Drupal 6 only) in order to recreate the view used for the Music page of this site, as well as the Recent Projects block on the Home page. To import this, go to Administer > Site building > Views > Import (admin/build/views/import).

A Nodequeue is used in this View (my Nodequeue is named music-film), so you should have Nodequeue installed when importing this View. If you don't want to use Nodequeue, you can change the sorting options to submission date or some other criteria after the View has imported successfully, and delete the Nodequeue relationship. The View also uses Views Carousel module, which you may need installed in order to import the View successfully.

You also need Views Carousel installed in order to import this View (only tested with 6.x-1.x-dev version).

At the Blocks administration page (admin/build/block), the Recent Projects block is added into the custom home_sidebar region that appears on the home page.

Simplified view: Lower on this page below the first Views import code, I've included a copy of the View with the Nodequeue relationship removed, and the display Style set simply to Unformatted instead of Views Carousel - this nearly removes any aspect of the View worth showing, though I'm including it as some people have requested it. If you do want the Views Carousel, you can simply change the Style back.

$view = new view;
$view->name = 'music';
$view->description = 'Music';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
  'nodequeue_rel' => array(
    'label' => 'queue',
    'required' => 0,
    'limit' => 1,
    'qids' => array(
      '4' => 4,
      '1' => 0,
      '2' => 0,
      '3' => 0,
    ),
    'id' => 'nodequeue_rel',
    'table' => 'node',
    'field' => 'nodequeue_rel',
    'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
  'field_media_image_fid' => array(
    'label' => '',
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'video-image_linked',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_media_image_fid',
    'table' => 'node_data_field_media_image',
    'field' => 'field_media_image_fid',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'title' => array(
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
  ),
));
$handler->override_option('sorts', array(
  'position' => array(
    'order' => 'ASC',
    'id' => 'position',
    'table' => 'nodequeue_nodes',
    'field' => 'position',
    'relationship' => 'nodequeue_rel',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => 1,
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'media' => 'media',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('title', 'Music');
$handler->override_option('items_per_page', 0);
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
  'teaser' => 1,
  'links' => 1,
  'comments' => 0,
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('style_plugin', 'viewscarousel');
$handler->override_option('style_options', array(
  'skin' => 'tango',
  'vertical' => 0,
  'start' => '1',
  'scroll' => '1',
  'visible' => 0,
  'animation' => '0',
  'easing' => '',
  'auto' => '0',
  'wrap' => '0',
));
$handler->override_option('row_options', array(
  'teaser' => 0,
  'links' => 0,
  'comments' => 0,
));
$handler->override_option('path', 'music');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'weight' => 0,
));
$handler = $view->new_display('block', 'Recent projects', 'block_1');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
  'field_media_image_fid' => array(
    'label' => '',
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'latest-projects_linked',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_media_image_fid',
    'table' => 'node_data_field_media_image',
    'field' => 'field_media_image_fid',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('title', 'Recent Projects');
$handler->override_option('footer', '<a href="/music">View more recent projects</a> &raquo;');
$handler->override_option('footer_format', '1');
$handler->override_option('footer_empty', 0);
$handler->override_option('items_per_page', 3);
$handler->override_option('row_plugin', 'fields');
$handler->override_option('row_options', array());
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);

Views import without Nodequeue or Views Carousel (see info)

$view = new view;
$view->name = 'music1';
$view->description = 'Music';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'field_media_image_fid' => array(
    'label' => '',
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'video-image_linked',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_media_image_fid',
    'table' => 'node_data_field_media_image',
    'field' => 'field_media_image_fid',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'title' => array(
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => 1,
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'media' => 'media',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('title', 'Music');
$handler->override_option('items_per_page', 0);
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
  'teaser' => 1,
  'links' => 1,
  'comments' => 0,
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('style_options', NULL);
$handler->override_option('row_options', array(
  'teaser' => 0,
  'links' => 0,
  'comments' => 0,
));
$handler->override_option('path', 'music');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));