Hi,
I'm building my user profiles with cck and the content_profile module. To explain my problem/question here's a little example:
The user profile containes fields to collect information about himself and his children (birthday, school and gender for each child). Because the quantity of children differ from family to family I don't know how many content fields are needed to be created in the first place (five children, six children … 20 children?).
Until now, all user information are stored in one content type (information about the user himself and the user's childrens information). I'm thinking about to separate the children's content fields from the user profile information and create a new content type for the children's information. Then a user could click "create a new child" such as creating a new blog entry. So he could enter as many information about his children as he needs I don't need to fear users with unbelievable amount of children ;).
Another way I thought about is to create content fields for 20 children (just to be safe!) so there would be 60 content fields (birthday, school and gender for each of the 20 children). Then I would utilize jQuery to hide all those fields and create an "add button" to unhide those fields (each click on the "add button" shows 3 more fields: birthday, school, gender).
My third option would involve an incredible amount of time to search the whole net for a module that would give me the "add button" on the edit page of a user's profile. Everytime a user clicks on the "add button" three content fields are created "on the fly". No extra content type, no pre-created content fields.
Which way is the best to go? I've really no idea.
Thanks for any help :)
Comments
Multiple choices
Second and third option, no ;)
There are two ways to achieve this kind of data structure:
-Stefan
Hi Stefan, thanks for your
Hi Stefan,
thanks for your reply.
That's the impression I was getting while I was searching for ;). So, my first idea (creating a separate content type) is the way people usually go when trying to achive such a thing? I'll get used to it ;)
So let's say the content type Parents contains the content fields Firstname and Lastname. The content type Child contains Birthday, School and Gender. Could you tell me how to "connect" these two content types by using "node reference" and "node relationship" so that a user is able to add new children to his profile while he's editing his own profile page (domain.com/user/1/edit)?
Thanks a lot! :)
An answer(:) and a Question(?)
@DrupalCuckoo: You should add a filed named children with multiple values, with the type of Node Reference field.
and here is my situation:
i have got some Cities. at the other side there are some Items. Every month, my editors should make a list of values of Items for each City.
how should I implement it with Drupal and two content-types of City and Item?
Try Flexifield
Hi DrupalCockoo
Try Flexifield at http://drupal.org/project/flexifield. I am using it successfully for similar scenarios to yours.
Also notice that Flexifield seems to be the viable solution while other solutions are being made stable http://drupal.org/node/773868
You can create a content type "child".
Then create a content type "parent" .
In the content type "parent" add a flexifield field of type "child" and set it to "unlimited" (that way you can add as many children as you like")
I hope these quick notes make sense to you
Good luck! :)
Ivan
thank you ivanpellegrin, I'll
thank you ivanpellegrin,
I'll give it a try (although it's still alpha and it hasn't been updated for almost a year!)
Best regards,
DrupalCuckoo
I've found another module ->
I've found another module -> http://groups.drupal.org/node/49558
What do you guys think about this one? Looks very promissing to me (and it's not alpha, it's already beta4). Did anyone tried this module out?
hi, I just wanted to state
hi,
I just wanted to state that this module didn't work for me at all. The first time you create a new node the default settings is that you get 2 entries (created by the module). You
can add more entries if you wish. But everytime you hit the "save" button it automatically creates a new entry (which will show up in the frontend).
Just try it out and you'll see whats I mean (I'm not sure if I explained it right).
So, I'm still searching for the right solution.
best regards.
subscribe
subscribe
subscribe
subscribe
Advanced - Nodes that can be referenced (View)
Advanced - Nodes that can be referenced (View)
how can i use it
and why we can use it ??