On a recent site design, I've often found the need to provide a field that, in general, references a node type or a user but would also have the ability for a user to enter a text string instead of a node or user reference.

In my mind, the feature would work like the nodereference usually does by providing a select list. An extra "other" option would be available in the list, though, and when the user selects the "other" option a text box would show up for a user to enter a text string.

From what I've read, it seems like the fAPI2.0 is perfect for this kind of dynamic form building, so I thought as 5.0 starts to roll in this would be a feature to start considering. Perhaps this would work best as additional functionality provided by a different module? Or part of a more general move to separate the entry form and UI side from the content type creation side?

thoughts?

Comments

yched’s picture

Status: Active » Closed (works as designed)

This is too specific. Fields provide "homogenous" content (especially "core" ccj fields", contrib field modules are free to be as complex as they wish...)

If you want to add logic (if (this field is empty) [display this other field}), you can do that with theming (see theme/README.txt in your cck folder), or with the "computed field" contrib module.