BoldSource - Bits and Beats from Blake Lucchesi

  • Random
  • Archive
  • RSS
'\x3ciframe src=\x22http://blip.tv/play/AYGF9G\x22 width=\x22500\x22 height=\x22304\x22 frameborder=\x220\x22 allowfullscreen\x3e\x3c/iframe\x3e'

Today I did a presentation on the Views module for Drupal 6 at the Los Angeles Drupal User Group monthly meeting. Below are my notes from the presentation as well as links relating to information I presented and further reading. The video recording of this presentation will be available later at http://drupal-la.blip.tv/

Agenda

During this presentation I will build a few different types of views pages while I show the features that views provides your Drupal site. I will mainly focus on building a set of photo gallery views that revolve around a base ‘photo’ cck node type. * Intro to views (what is it?) * Building our first view * Display types * Using Filters * Using arguments

Modules Installed

Core

  • Profile
  • Search
  • Taxonomy

Contributed

  • Admin Menu (admin_menu)
  • Advanced Help (advanced_help)
  • CCK (content)
  • CVS Deploy (cvs_deploy)
  • Devel
  • Drush
  • Filefield
  • Imageapi
  • Imagefield
  • Imagecache
  • Token
  • Views

Contributed module that provides alternative views display types:

  • Calendar
  • Views Slideshow
  • Nice Map (demo)
    • #drupal
    • #ladrupal
  • 2 years ago
  • Permalink
  • Share
    Tweet

Notes from DrupalCampLA 2008

This past weekend I made two different presentations and participated in a panel. Below are my notes from the presentations:

Drupal FormAPI

This presentation was a quick run down of how to use the FormAPI to create… forms! Examples included a basic one page form and multi-step forms using $form_state[‘storage’]. There was also a demo of how to use the new #ahah feature. After the presentation I was asked a question about how to add additional form elements to forms using the new #ahah features. My answer was that there is now a module out called ahah_helper which makes doing something like this very painless! You don’t have to register any menu callbacks or do any of the lifting outside of your original form builder function. Its still fresh out of the kitchen but I would recommend giving it a try.

References

  • Online: Drupal API Docs, FormAPI Quick Start
  • Online: Drupal API Docs, FormAPI Reference
  • Multi-step forms
  • Online: Drupal FormAPI 5.x to 6.x (d.o)
  • Online: Drupal Forms 5.x to 6.x (Lullabot)
  • Online: Drupal AHAH in core
  • Online: Theming the Drupal Registration Form
  • Presentation: Drupal FormAPI (5.x)
  • Book: Pro Drupal Development
  • Book: Learning Drupal 6 Module Development

Drupal 6 Theme Functions and Template Files

Sometimes you can’t theme everything with css. You just can’t. This is where themable functions come in to save the day. The clean to implement, easy to use saviors to themers all over Drupal-land.

Thanks to all who attended my theme function presentations. At the culmination of our 3 one hour long sessions we went from what the template engine is, to calling theme functions in your template files and all the way to implementing our own function and template overrides with the help of the Devel module’s themer module.

Throughout the sessions I sprinkled in tid bits of debugging your code with the use of (Remember devel module must installed and active on your site). Additionally here is the snippet of code we run at the top of the template.php file during development to make sure that Drupal is picking up all of our new template/theme function changes. Remember to disable this before going to production.

I would say more here about what was presented but it really is too much and when the video comes out you will hopefully be able to watch and follow along again. In the case that it doesn’t I have posted up my presentation slides which were a rough outline that I followed during the presentation and I’ve also posted below the references listed at the end of the presentation. I highly recommend reading through these to help guide you on your journey to understanding Drupal’s theming system.

References

  • Online: Drupal API Docs
  • Online: Drupal Themes 5.x to 6.x Documentation
  • Online: Theme Developers Guide (d.o handbook)
  • Drupal Theming and Site Building Workshop
  • Screencast: Theme Developer Module
  • Group: Theme Developers group
  • Book: Drupal 6 Themes (Packt Publishing)

Thanks for joining me at DrupalCampLA!

    • #drupal
    • #ladrupal
  • 3 years ago
  • Permalink
  • Share
    Tweet
'\x3ciframe src=\x22http://blip.tv/play/AdSzNo2oTg\x22 width=\x22500\x22 height=\x22354\x22 frameborder=\x220\x22 allowfullscreen\x3e\x3c/iframe\x3e'

Part 2 of my presentation on the building of the R.E.M. tour website at an LADrupal meetup.

    • #drupal
    • #ladrupal
    • #wbr
    • #drupal-video
  • 3 years ago
  • Permalink
  • Share
    Tweet
'\x3ciframe src=\x22http://blip.tv/play/AdS0M42oTg\x22 width=\x22500\x22 height=\x22354\x22 frameborder=\x220\x22 allowfullscreen\x3e\x3c/iframe\x3e'

Part 1 of my presentation on the building of the R.E.M. tour website at the LADrupal meetup.

    • #drupal
    • #ladrupal
    • #rem
    • #wbr
    • #drupal-video
  • 3 years ago
  • Permalink
  • Share
    Tweet

R.E.M. Tour Website Case Study

A little bit of foresight and planning went a long way in the creation of the new tour website for rock legends R.E.M. I’d like to take a moment to share with everyone the approach we took in creating the RSS powered social media website that centralizes concert media from various sources across the web.

Website: http://tour.remhq.com

Site Architecture

Taxonomy

At the most basic level the site utilizes taxonomy as a way to categorize content (esp. media) by tour date. Using a taxonomy centric approach was not only semantic but allowed us to use the power and interactivity of other modules to make for an easy to manage and easy navigate website.

Content Construction Kit and Emfield

Using CCK and Emfield we created new content types for each type of data: video, photo, blog, twitter. The video content type had an embedded video field and the photo content type had embedded photo field. The blog and twitter content types used the body as their way to store the important feed data. The creation of different content types was an essential step in allowing us to filter the types of content easily using views, as well as providing an easy way to theme each content type.

FeedAPI

The FeedAPI is the core of the website, pulling in data and creating new nodes from data found in the RSS feeds. Using the FeedAPI module we created a new feed node for each web service (youtube, flickr, technorati, twitter) and concert date (each date has its own unique tag to distinguish the events). If you are not familiar with this module it allows you to specify which content type to use when creating new child nodes from the feed data (now you see the importance of the step above).

FeedAPI Mapper

Using FeedAPI Mapper we were able to take specific parts of data from each feed and map it to the fields of our content type. This means that with our video feeds, we could map the video url from the RSS feed to the embedded video field of our video content type.

Views and Views Panes

Throughout the site you will notice many blocks of media, these are all just different implementations of four basic views. Each view merely filters out the content to be only nodes that are published and of the particular content type: video, photo, twitter, blog. Additionally each blog has a single argument, a taxonomy term argument that allows us to specify which tour date we want to browse through. By setting the argument default to ‘display all values’ instead of ‘return page not found’ we were able to recycle the views and use them on the homepage to display most recent content (each view has a sort by node created time descending as well). Utilizing the views panes module (packaged with Panels 2) we were able to expose our views to the panels module and link our views arguments to a panel context (discussed below).

Panels

Using the panels 2 module we were able to override the display of the standard taxonomy/term/term-id pages (as well as pathauto to give us paths like this http://tour.remhq.com/tour-date/may-24th-the-gorge-washington). To do this we created a new Panel Page with the url of (taxonomy/term/%), in the context settings I created a new argument context for the term id. Using this context allowed us to filter all of the views content on that page to be for only a particular concert date. Also note that when adding the argument context we set the title value to “%term” which overrode the page title with the taxonomy term name. You’ll also note that we created a new homepage using the panels module as well, only there are no contexts because we wanted the views to ‘display all values’ as mentioned above.

Module List

Core Modules:

  • Comment
  • Path
  • Taxonomy

Contributed Modules:

  • FeedAPI (5.x-1.2)
  • FeedAPI Mapper (5.x-1.x-beta6)
  • Emfield (5.x-1.2)
  • Panels (5.x-2-beta3)
  • Views (5.x-1.x)
  • Taxonomy Context (5.x-1.0)
  • Mollom (5.x-1.3)
  • Captcha (5.x-3.1)
  • Pathauto (5.x-2.x)
  • Token (5.x-1.x)

Custom Taxonomy Mapping Module: There was one thing that I needed done in order to tie the whole taxonomy term as concert date approach together, and that was to make it so that the new nodes that the feedapi node created were categorized under the same taxonomy term as the parent feedapi node. This made it so that for each tour date we could have any number of feed nodes associated with it, subsequently all nodes created by parent feed nodes would be tagged with the proper taxonomy term (concert date). The code below is what accomplishes this:

 /**  * Implementation of hook_nodeapi  */ 
function feedapi_taxonomy_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL){
switch ($op) {
case 'update':
 case 'insert':
// If we have a new feed node check its parent to see which taxonomy terms it has.
  if ($node->feedapi_node->feed_nids) {
$query = db_query("DELETE FROM {term_node} WHERE nid = %d", $node->nid);
 foreach ($node->feedapi_node->feed_nids as $key => $nid) {
$parent = node_load($nid);
foreach ($parent->taxonomy as $key => $term) {
 $node->taxonomy[$term->vid] = $term->tid;
 }
}
 taxonomy_node_save($node->nid, $node->taxonomy);
}
 break;
}
}

I created this snippet in a custom module that I named “feedapi_taxonomy”, a package of the module is attached for those whom wish to use it for their own projects.

Theme

The theme used on the site is none other than a very slightly modified version of the Grid Inspired theme. It is very simple and provides an easy interface for users to navigate. Some of the specific changes to the theme include adding padding for paragraph tags, removing the $links variable from node.tpl.php and adding a new banner across the top of the page in page.tpl.php.

Documentation and Resources

Recently there have been some screen casts and documentation that cover the use of the Feed API module and Panels 2, below are some of those resources.

  • Embedded Video feeds.
  • Development Seed Online Video Screencasts
  • BoldSource LADrupal Panels Presentation Notes

Recognition and Thanks

This project was commissioned by Warner Bros Records; their ideas, funds and collaboration are what drove the project to completion. Thanks also to those module developers/maintainers who have put together and maintained quality contributed modules which power the website.

    • #drupal
    • #wbr
  • 3 years ago
  • Permalink
  • Share
    Tweet

Drupal Search Engine Usability

Today I found a very informative blog post on the boxes and arrows user interface and web usability website that talks all about creating a better search experience for website visitors. During the Birds of a Feather session at DrupalCon Boston many of these key aspects of search were discussed and are on the agenda to be addressed at the Minnesota Search Sprint next weekend. Some of the major concepts he brings up are things like sorting by tags and providing faceted searches to allow for further refining of results AFTER the initial search. The big key here is that more work must be done to provide a better search interface as opposed to developing the magic algorithm that reads peoples minds when they type in a 3 word query.

GET INVOLVED

How can Drupal’s core search be improved to make your site more search friendly? We want to know!. Don’t have specific requests? You can still help! We need people to help us test the improvements that will be made during the Minnesota Search Sprint and afterwards. As a matter of fact, there are a number of great patches that just waiting for review so that they can be put into Drupal 7.x.

    • #drupal search
    • #drupal
  • 3 years ago
  • Permalink
  • Share
    Tweet
← Newer • Older →
Page 2 of 2

Portrait/Logo

About

I'm Blake Lucchesi and I'm the founder and lead developer of ChapterBoard, a web app for fraternities and sororities.

Me, Elsewhere

  • @blakelucchesi on Twitter
  • BlakeLucchesi on Last.fm
  • Linkedin Profile
  • blakelucchesi on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr