Seems like this feature request would already exist.. Don't know if I trust the brand new issue search.
Right now if I create a field, say email, and i want it required on one content type and not the other, this is not something i can do. Is there a systematic limitation on having this ?
Comments
Comment #1
infojunkieSubscribe.
AFAICT, the 'required' attribute is currently stored in table content_node_field, not content_node_field_instance. That's why it applies to all instances of that field. Whether it *needs* to be stored there or just happened to be needs more investigation.
Comment #2
karens commentedThis would be a structural change, which isn't going to happen for the D6 version. We are already deep into D7 fields in core, no one has time or interest in making structural changes to the D6 version at this point.
Comment #3
infojunkieSo can we request that change for D7?
Comment #4
karens commentedFields are in core for D7, so it isn't a CCK issue. And pretty much everything about fields is different for D7, but this is one of the changes that has already been made.
Comment #5
yan commentedBut it was like that in 5.x, right? I don't see the point in not allowing the "required" setting on a content type basis. So now I need to create the exact same field twice just to have a different field setting on every node type?
Comment #6
karens commentedNo, it worked the same in D5 and D6 (and D4.7 for that matter), D7 is where things will change. And yes, you have always had to create different fields if you want different settings.
Comment #7
betoaveigaI don't know if i'm wrong but... Using hook_form_alter and the #after_build function it's possible to achieve this behavior.
Your field should be set as non mandatory, and using hook_form_alter with an #after_build function you can change this value on the fly for specific node types or situations (I need this only when the widget was option).
The code of what I'm doing right now is below. Until know everything seems to work fine. If you have devel installed you can remove the comments in the kpr function to see the structure of the form.
PD: This thread is old... but this may help somebody... like me :)