hi!
a big step in development for me was the "bio node required" setting!
and still i would like to have certain fields be entered on the registration form directly (sure you know from other user's posts).
maybe there is an *easy* way with integrating and using nodeprofile:
i believe that there must be a way to have 2 bio nodes, one is visible/required at the registration form (using nodeprofile setup),
the other one is integrated in the profile page (as is).
so my wish is to have 2 different bio nodes to accomplish this, but both should store the data in the same container.
this could give me the possibility to have:
- a small subset of required AND optional fields on the registration form
- the full list of fields available in the 'my account' setting
if you have an idea how to do this, but you dont want to implement this in future releases, lz give me a hint!
thank you for this fantastic and *very* helpful module!
sam
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | bio-cck-fields-on-registration-form.png | 17.97 KB | webchick |
| #9 | bio-settings-form.png | 31.04 KB | webchick |
| #9 | bio-fields-on-registration-182266.patch | 6.5 KB | webchick |
| #8 | bio-fields-on-registration-182266.patch | 5.55 KB | webchick |
| #7 | bio-fields-on-registration-182266.patch | 4.41 KB | webchick |
Comments
Comment #1
webchickI'm going to give this a shot. We'll see if I can pull it off or not. ;)
My plan:
- In hook_form_alter, add an option "Show this field on the registration form" like we have on profile module for any CCK fields attached to the "Bio" node type.
- If any of those fields have that option (or are set required, which will mean that they always show up here), then auto-create the profile node on user registration. Unpublished by default.
- Once a user logs in for the first time, mark their profile node published.
Comment #2
jscheel commentedHey, just subscribing. Let me know if I can help!
Comment #3
webchickThis isn't probably even worth marking code needs work yet, but here's the code that puts the "show on registration form" option on bio CCK fields.
Comment #4
webchickOops. Didn't mean to unassign myself.
Comment #5
michelleThanks for doing this. Your plan sounds great.
Michelle
Comment #6
webchickActually, I spoke with Jeff (the module author), and he brought up the idea of simply adding a new table to the settings page for "field options" which for now will only contain "Add to registration form", but could in the future contain whatever. So here is the code that goes that way instead. This'll make it faster to simply check off things after the fields have been created, rather than having to edit the fields, and the code is a bit cleaner too, which I like.
Comment #7
webchickThis patch has the fields showing up on the form, although they don't do anything yet.
Comment #8
webchickOk, here's a patch that seems to be working, at least for simple text fields. Still needs more testing, but I'm marking for review.
Comment #9
webchickOk there were a bunch of problems with that last patch, but I really seriously think this one is ready. ;)
Now, there's a togglable option in the settings form to enable this feature or not, and if it's enabled you can choose which CCK fields to show on the registration form. Required fields are, well, required, so they'll automatically be checked off and can't be unchecked. The bio node will then be created in the background when a user registers.
Attached are the patch and screenshots showing it in action.
I've tested this under the following conditions:
- Text, Number, Node Reference, User Reference, and Date fields.
- A variety of widgets (Text, Options, Autocomplete, Select..)
- Required fields
- Fields with allowed values requiring validation
- Multiple value fields
- Etc.
The only one I can't get working is Imagefield, but the maintainer said, "That's no surprise" so I'd love it if we could fix this in a separate issue.
Comment #10
webchickMore descriptive title.
Comment #11
robloachWicked! Tested it out, and worked like a charm! Definitely looking forward to using this in the future. Nicely done, Angie. Much better then the
drupal_gotohack. It breaks for me with ImageField 2.x, but I'm sure it's something wrong with my permission setup...Comment #12
webchickjjeff gave me commit access, and so this is now fixed. Thanks for the review, RobLoach!
Comment #13
robloachNo problem, AngieByron!
Comment #14
Christefano-oldaccount commentedOoh, this looks wonderful. Many thanks for getting this done.
Comment #15
prakasht commentedHello Angie
Just want ask a quick question, How to get all the field groups & non-field group (including fields) whatever specified in the bio content type to render in the setting page of bio and if the display in registration form selected then how to render exactly specify in bio content type. Waitng for your reply..
As I think this method need to change... $fields = _bio_get_fields();
Regards
Comment #16
webchickHm. I don't know if I understood that question.
Are you saying you want to put arbitrary CCK fields on the registration form that may or may not be associated with the Bio node type? I would recommend doing that in a custom module in the same way that bio.module is doing it here. You could file a separate feature request/patch for that, but I don't personally have an interest in working on that functionality, sorry. IMO it's out of scope for Bio module.
Comment #17
SamStealth commentedgreat improvement!
tested with text fields, works fine!
but:
i would remove the "always show required fields on registration form" option.
so i am able to decide, which fields are *very* required.
and:
i am missing the "enforce bio node" option. i thought it was ready and working already!
keep up the good work!
Comment #18
robloachThe "Enforce Bio Node" option isn't needed when we have this functionality, because if one field in the Bio node is required, then the creation of the Bio node is taken care of for us!
Comment #19
webchickSorry, I can't do that. If all required fields aren't filled in, it'll cause the bio node to fail to create in the background.
Comment #20
webchickI just committed the following patch which fixes the problem of the CCK fields being nested inside of themselves.
So now instead of it being:
$form['field_bio']['field_bio'][0]['value']
it's:
$form['field_bio'][0]['value']
Comment #21
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #22
mrgoltra commentedsubscribing