Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Leveraging Drupal: Getting Your Site Done Right ISBN: 9780470410875
This is the forum to discuss the Wrox book Leveraging Drupal: Getting Your Site Done Right by Victor Kane; ISBN: 9780470410875
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Leveraging Drupal: Getting Your Site Done Right ISBN: 9780470410875 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 6th, 2009, 01:24 PM
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default One to many with CCK?

Following your excellent book I have learned lots about CCK and Views and am confident now to use them.

One question though...

I'd like to have a user fill in a form that has a parent name, e.g. father's name, and then a list of childrens' names and ages.

I can see how to have individual fields that can have 2 to unlimited values, but I can't see how to link child's name to child's age to child's gender.

Is CCK up to that? Is that the right way to do it?
Reply With Quote
  #2 (permalink)  
Old May 6th, 2009, 05:04 PM
Wrox Author
 
Join Date: Nov 2008
Location: Buenos Aires, , Argentina.
Posts: 23
Thanks: 0
Thanked 5 Times in 4 Posts
Default

Quote:
Originally Posted by brookie View Post
Following your excellent book I have learned lots about CCK and Views and am confident now to use them.

One question though...
I'm happy you found my book useful!

Quote:
I'd like to have a user fill in a form that has a parent name, e.g. father's name, and then a list of childrens' names and ages.

I can see how to have individual fields that can have 2 to unlimited values, but I can't see how to link child's name to child's age to child's gender.

Is CCK up to that? Is that the right way to do it?
CCK is very much up to supporting one to many relationships via the node reference field.

You would need to create a child content type with name, age, etc., and have a multiple node reference field included in the profile content type.

However, CCK off the shelf is not quite up to what you want in terms of being able to create new child nodes as you are editing the profile.

However, several contributed modules are capable of supporting that, see:

1. Node relativity: http://drupal.org/project/relativity for parent/child relationships, where the child can be created while editing the parent's form.

2. See this discussion: http://more.zites.net/embed-a-node-form-with-drupal-6 with a downloadable example: http://cvs.drupal.org/viewvc.py/drup...embed_example/

Let me know how this goes,
__________________
Victor Kane
http://awebfactory.com.ar
Reply With Quote
  #3 (permalink)  
Old May 13th, 2009, 07:41 AM
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks

Working on it - will let you know.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 10:45 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.