[support] Newbee: How should I plan this?

Larry Garfield larry at garfieldtech.com
Thu May 17 05:43:18 UTC 2007


On Wednesday 16 May 2007, A-NO-NE Music wrote:
> Larry Garfield / 2007/05/16 / 11:56 PM wrote:
> >You're already on the right track, then. :-)  I'm not entirely clear as to
> >your data model, though.  Are Discography, Musicians, and Schedule all
> > lists of all musicians on file, just showing different data?  Are they
> >searchable/sortable?
>
> Thank you so much for your detailed response.  It was a great help for
> thinking process, while I realized I should had mentioned an example.
>
> Say, I have my own show the day after tomorrow.  Both vibraphone player
> and the bass player are also performing for someone's jazz orchestra
> with me on Saturday.  The guitar player for my show Friday have played
> for a few of my CDs, while both of us played for someone else's CD as
> well as major commercial shows.
>
> See, we the jazz musicians go wherever calls us.  This is why there will
> never be a band with steady members.  My original band will never play
> again since the drummer has moved to NYC and touring all the time, and
> the pianist became a successful Verve record artist.  In other words,
> the list of musicians who collaborate/collaborated with me is quite
> long.  We have to grab who is best and available for the show date every
> time.
>
> Example:
> I want to have next show announcement promoted on the front page.  I
> maybe the leader, or I may be playing for someone's show.  I want to
> list the musicians for the show.  You click on one of the names.  The
> new node of the musician opens, where all the recordings and the gigs
> that musician played with me get listed as well as the hyperlink to the
> musician's home page.
>
> Boy, it sounds a lot of work required already.
>
> My current site's, not Drupal but simple PHP partially done by myself,
> schedule section is done with 3 MySQL tables, one for the show date, one
> for each band I am currently working for, and one for the venues we
> often play.  I only need to add the show to the date table, and the band
> hyperlink and the venue hyper link are automatically attached.  I was
> hoping something similar to this data model to the musician list (tho I
> have to plan for this Schedule data model in Drupal 5.1 as well).
>
> Do you think I should just create a site with simple pages first then
> improve later?  I am kinda afraid I will never finish Drupal site if I
> am stuck like this on each steps.

Ah, OK, so you want a booking setup of sorts.  You can certainly start with 
static pages if you want, but if you really want to use Drupal to its fullest 
potential it's important to go through this "think it through" step.

Here's my suggestion.  See if you can follow.  This is where Modern Drupal 
really shines. :-)

Musician node type: has name, website (link CCK field), etc.  Also has a 
viewfield (CCK field) of a view that lists Show nodes that reference that 
musician.

Show node type: Has name, date (date CCK field) nodereference field to a Venue 
node, and a multi-value nodereference field to Musician nodes that lists the 
musicians playing there on that date.

Venue node type: Has a name, location (address CCK field), and other stuff.

Viewfield is a really weird module that lets you have a field on a node that 
is actually a the rendered version of a view.  So that field "becomes" a list 
of Show nodes that musician has performed in.  You can also have a 
nodereference field allow only nodes of a certain type, or offer a select box 
from, get this, a view. :-)  (Views and CCK have a rather incestuous 
relationship, which is where so much of the power comes from.)

So now you can create lists of shows, lists of venues, lists of musicians, 
etc.  That includes "the one earliest show happening after right now" for 
your front page, for instance.  

I don't think you'd even need any custom code whatsoever for the above 
functionality.  You may for your theme, depending how you want it to look, 
but the actual functionality is all there.  

Does that help to see how to map out a data model in Drupal?  As a homework 
exercise, consider how you'd then add a "Recording" node type that would be a 
CD of a given performance, and how you'd access it from Venues, Shows, and 
Musicians.  That's why I said it's better to have a richer data model than 
you need, since you can then extend it like that.

Definitely have a read through the CCK and Views module categories on 
drupal.org.  Even if you only use one or two of each, just seeing what is 
possible can often give you ideas for how to leverage it later.  

Cheers.

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


More information about the support mailing list