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
You will likely need a custom UI, but if you are using Drupal 6, you might have some luck using http://drupal.org/project/noderelationships
On Mon, Aug 15, 2011 at 4:24 PM, Peter Keane pkeane@mail.utexas.edu wrote:
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 -- [ Drupal support list | http://lists.drupal.org/ ]