Warner Brothers Records just launched their new web site which is now running on Drupal. The site is part of a Drupal multisite setup, designed with help from Bryght to meet the needs of WBR and providing the ability for each of their artists’ sites to share the same Drupal codebase (Drupal v5 of course). All code revisions are managed with SVN on a SAMP (Solaris/Apache/MySQL/PHP) stack with APC for caching (go open source!) The video files are delivered using the Akamai CDN network. There are some fun, unique features so be sure to check out the draggable node panel and the nice jquery/interface/ajax(ahah) artist slider! This writeup explains some of the information and details on the setup, modules, content types, and custom parts.
The site was designed by Prod and the site setup, customizing and theme done by Chris and Sarva Bryant from Gravitek Labs. Warner Bros. Records provides their own hosting and infrastructure, maintained by in-house tech geeks Ethan Kaplan and Shaun Haber.
WBR Setup and Theme Details
Here is a listing of the key modules used: (a huge thank you to all the respective developers!)
CCK (and a few cck field types)
Views (plus few additional views modules)
Flash FLV Player (project will be added soon)
Dynamic Views (custom module for ajax slider and ajax node reloads- http://drupal.org/project/dynamic_views)
WBR Utility module (custom, mainly for the theme.)
Content types, specific fields, and views were setup for the news, videos, artists, albums and faq with node references used between the different types to relate content.
The Drupal theme was built from the ground up using Josh Pigford's excellent XHTML/CSS markup and works in conjunction with the wbr_utils module to provide some of its features.
1. Easily skinnable by creating a new style.css file in a sub-directory of this theme
2. Content is turned into a floating/draggable box when a large image is attached to it. The image is set behind the floating box.
3. Nav text and block titles are turned into images if the appropriate image exists in the images/text folder
4. Draggable slider to select artist genre and update the page dynamically (AHAH)
5. Display service links in the right places
6. Custom pager to show next/previous nodes of main content
Important files and directories in the theme:
1. template.php - Main theme file
2. style.css - Main stylesheet
3. page.tpl.php - Markup for the site layout
4. node.tpl.php - Individual node template file
5. block.tpl.php - Single block template file
6. js/interface.js - Interface library to handle special effects
7. js/wbr.js - Setup various special effects
8. images/text - Images that overwrite various titles in the site. Particularly for the main nav and block titles.
By adding a new style.css file, with the option of also adding an extra template.php file, in a sub-directory of the theme, a new sub-theme will be offered at admin/build/themes. This theme will use all of the exact same settings as the main theme, only it will add the extra stylesheet to the page, allowing for a custom look. Features can also be modified by another template.php file in the sub-theme folder.
When an appropriately sized image (685 width) is available in the "image" field of nodes, that image will get displayed as the background for either the full node, or the teaser node if only one teaser is displaying. The image will then disappear from inside the content, and the content itself will get turned into a floating, draggable box overtop the image. The box will be constrained by the boundaries of the image. The position of the box will also be saved when you move it around so when you refresh it will stay where you left it. This functionality is all handled by jQuery in js/wbr.js.
Draggable Slider for Artist Genre with AHAH dynamic page updates
Custom service links
The service links module doesn't always place the service links in desirables places in the content, so this theme will determine what service links need special attention and displays them appropriately. For instance some service links need to be displayed before the body of the node instead of after.
Views that use a pager, but only display one item per page will be setup with Prev and Next links to replace the pager. This is complimented by having the view provide a teaser list as a block on the same page. The block, which typically does not support pages, is setup with a standard pager to browse the content.
The custom modules created for the site to achieve desired functionality are:
The wbr_utils module provides general tweaks and customizations along with helping out the wbr theme. Instead of providing settings through an administration interface, multiple site-specific settings are defined at the top of the module through php defines. These define the names of content type fields, content type groups, and views to be treated specially in the site.
1. Save drag position of floating box
2. Define the main image field and provide settings to select a default image along with a default size imagecache preset
3. Provide settings to select video fields so that it can create the embedded video for those fields using the swftools module.
4. In conjunction with the wbr theme, remove service links that will be displayed elsewhere.
5. Add watch links to video files
6. Extend views functionality by providing duplicate views blocks that replace the "Read More" link with a full-blown pager.
7. Custom display of 2 groups of artist links
Save Drag Position
This is as it sounds, whenever the floating box provided by the theme is moved, it sends its position back to the server using ajax in the form: wbr_utils/drag/x/y This value is then saved to the session and used to set the position of the block on subsequent reloads.
Main Image and default image
The theme handles displaying the image, but the module contains the php define that sets the field that will contain the main image. At admin/settings/wbr_utils you can also set the default image to be used when an image is not set for the field. A setting is available to handle smaller default images used in other areas of the site; specifically for artist thumbnails on the artists page.
At admin/settings/wbr_utils again, you can select fields that will contain urls to a flv file on an outside server (Akamai CDN in this case.) The module then replaces that field for display with the embedded flash code to display the video. The "swf()" function is called to obtain the embedded object which in turn uses the flvplayer module to setup the object.
Pager View Blocks
The views module only allows blocks to have a "Read More" link attached to the bottom so you can view the full page of listings for the view. In order to provide the desired functionality of a block provided by a view with a full-blown pager, duplicate blocks, named Pager Enabled: viewname, are provided with this module. The code to create the block is exactly the same as the views module code, except it passes in the appropriate parameters to the view_build_view function to enable a pager.
With the CCK Link field module the text title displayed for a link can be done in one of three ways: display the full url of the link, display a title specified in the node, or display the text "Link". Displaying the "Link" text is close to what we required, except we needed to be able to define that text in the actual field settings (not in the individual nodes). We wrote a patch that takes link fields inside a particular group and uses the label of the field as the text for the link.
The Dynamic Views module provides the functionality behind the artist slider (http://warnerbrosrecords.com/artists). It turns views and views filters in dynamic content. All of the functionality provided by this module is enabled by selecting a "Block/Page Type" (Teaser/Node/List/Table) on a views edit page. Due to limitations in the views module for not being able to create pagers in blocks, this module also provides this functionality.
1. Dynamic filters
2. Dynamic teasers
3. Dynamic nodes
Dynamic filters is what provides the functionality behind the artist slider. 4 new view types are provided for blocks and pages each replacing their respective Teaser/Node/List/Table type: Dynamic Filter: Teaser List, Dynamic Filter: Full Node, Dynamic Filter: List, Dynamic Filter: Table
- ) of links that dynamically calls back to the server for the updated content for the selected filter.
Functionality may be a little unfinished, but, there are 3 cases for these:
1. Dynamic block coupled with a Dynamic page (same view, either teaser of node)
2. Stand alone dynamic block
3. Stand alone dynamic page
For #1, the module will provide two features. One, it will turn the pager for the block into a dynamic pager. When you click a page #, it will dynamically update the content of the block with the updated page items. Two, if you click on a node url in the block, it will dynamically load the node you clicked on in the main content area. However it will not just load the node page (node/#nid), it will load the page # of the current views page that includes that node. This way it can keep the dynamic content rolling without losing it by going to a node/#nid page. This is ideal by creating a Dynamic Node as the page and limiting the # of nodes to the page to 1 (and possibly turning off the pager)
For #2, it can just dynamically update the content of the blocks when you click on a pager item, but there is no dynamic functionality when clicking on a node.
#3 would functionality exactly the same as #2
The flvplayer provides the capability to setup and create an embedded flash video using the free FLVPlayer. The module does not handle actually determining where to display the video, but coupled with the "swftools" module a custom module can easily create the embedded code using the provided "swf()" function.
The reason behind using this free player was for its capabilities to play flv files defined in an XML config file that play off a Flash Server and for its skinnability.
The site was a lot of fun to build and we were happy to get to create some unique functionality and custom modules in the process. So far the response has been great and the site is running smoothly. Let us know if you have any questions and we'll do our best to answer them. :-)