[support] many-to-many help needed

Peter Keane pkeane at mail.utexas.edu
Mon Aug 15 22:24:05 UTC 2011


Greetings -

I am not exactly sure how to approach a particular data modeling task
in Drupal.  Although I am newcomer to Drupal, I have experience w/
relational database modeling (part of my ramp-up w/ Drupal is figuring
how to map Entity-Relational concepts to Drupal). I'm faced w/ this in
a few places on my current project, but I will describe just one
example (simplified for illustrative purposes):

I have a "book" content type and I have a "fictional character"
content type.  I need to record the page number on which a particular
character first appears in a book.  Note that a character can appear
in many books and that a book (typically) has many characters.

I can acheive this with an "appearances" content type which had node
reference fields for both "book" and "fictional character" and a field
for page number.

What I am unclear on is how best to present this to a user who is
entering data.  In my particular case, the "book" content type will be
pre-populated.  I'd like to have a form for creating a new character
which includes a pull-down list of books.  When a book is selected,
another widget appears in which a page number appears.    This "pair"
of book & page needs to be repeatable, since a character may appear in
many books.

The trick here is to have a form for creating one content type
"fictional character" that upon submission, created not only the
"fictional character" instance, but the necessary "appearance"
instances as well.

Any ideas (even if only a pointer to a module that might get me
started, similar examples, or documentation) would be greatly
appreciated.  If writing a custom module is necessary, that is
something I can probably tackle (any tips re: apis & such in that case
would be welcome).

--Peter Keane

Liberal Arts ITS
The Univ. of Texas at Austin


More information about the support mailing list