Selection of nodes only by Titles within a SELECT is not always user-friendly.

Oftentimes a node being selected carries more data that needs to be exposed in nodeference selector (e.g. a teaser preview, a description or whatever else).

We need a checkboxes/radiobuttons option that will run every node through a theming function to pick the right fields to present as option labels.

Comments

yched’s picture

The 'advanced' setting for the noderef field already allows to to display additional fields for candidates nodes. (Views module required)

You might even display a node's body or teaser, using the appropriate view field (probably only suitable for the autocomplete widget...) - this might require some theme / css tweaking for a correct display inside the autocompletion box, though...

A radio / checkbox widget does not seem appropriate when there is more than, say, 10-15 candidate nodes.

dkruglyak’s picture

Yes, I tried this option.

Sure this is better than nothing, but it provides very weak control over display. Not every data element belongs inside a SELECT dropdown or autocomplete widget.

Users who are not tech savvy need an option of seeing all choices laid out on a page when it loads. This needs to be fully themeable.

tomsun’s picture

My vote on an checkboxes / radiobuttons option! Would increase user-friendliness - no control-clicking needed for starters...

yched’s picture

Well, if someone comes up with a patch that implements a checkbox / radio widget AND behaves nicely when there is a great number of nodes, I'll be happy to commit it...

dkruglyak’s picture

What are your suggestions for behavior with many nodes?

Maybe the way to go is use a view but instead of outputting its fields in select (like now), output it through checkboxes / radiobuttons. The view can be fully themeable and use a pager.

yched’s picture

http://drupal.org/node/63825 has been marked duplicate of this

jbhan’s picture

i agree that this would be a great option, a way to build a taxonomy structure without relying on select boxes. especially if we are leading our users through the submission of nodes.

this function is really only useful with a limited number of terms, maximums being maybe number of states in the us, or something like that (not that a select list wouldn't be more useful there)

but with small numbers of vocab terms in mind, is there a way to allow the cck field creator to select how many radio/checkboxes to allow in the form? have it as a separate selection in the field creation and set a hidden max at some number (50, 100)...this way limits the damage if somone links to a vocab with 1000's of terms.

moshe weitzman’s picture

in OG, i show radio buttons and checkboxes until i get a list with more than 20 items and then switch to a dropdown. works for me.

moshe weitzman’s picture

Title: nodereference: Need a checkboxes/radiobuttons widget » nodereference: Use checkboxes/radios when only few nodes are referenceable
quicksketch’s picture

Title: nodereference: Use checkboxes/radios when only few nodes are referenceable » nodereference: Add Checkboxes/radios and Text Field
Version: 4.7.x-1.x-dev » 5.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new5.78 KB

Though a new concept to CCK, the switching method does seem appealing.

I didn't have that in mind when I wrote this patch, but that could make a great addition in the future (and apply to all types, not just nodereference). This patch instead is intended to add consistency and improvements to the available default CCK widgets.

This patch provides two different widgets: the desired checkboxes/radios widget as well as a plain text widget. Plain text is simply a integer nid for the reference.

A similar patch could easily be ported to userreference also. Applies against 5.x.

quicksketch’s picture

How thoughtless of me! Credit for the Text Field widget portion goes to Eaton, as I directly pulled that code from his cck_extras.module in CVS.

loginsvariaditos’s picture

I can´t make the patch work. I got the correct nodereference.module and patch it (both with cygwin and manually) but it didn´t work.

Does anyone have the module patched and working. Could you upload it please? Thanks a lot!

dkruglyak’s picture

Title: nodereference: Add Checkboxes/radios and Text Field » Usability of Node Selectors
Category: feature » task
Status: Needs review » Needs work

Bumping and reframing the issue.

This is really not about just checkboxes/radiobuttons, but rather ability of users to easily select the nodes they need. Output of node listings along with checkboxes / radiobuttons is one way to do it but not the only.

There should be a way to configure the appearance of autocomplete results, so that users could search and select nodes based on any relevant CCK data, not just titles. I suggest custom hook / theming function for creating custom search/output rules.

This could be yet another CCK widget type for nodereference.

moshe weitzman’s picture

what do folks think of the "automatic switching" approach that mentioned above. OG uses it successfully. Use radios/checkboxes if less an x items, and use dropdown if more than that. I am willing to do a patch. This could be a new 'smart' widget or an enhancement to the existing select widget. feedback wanted.

dkruglyak’s picture

That would be great. Even better take a look how autocomplete selectors work on Facebook. For example when you choose from thousands of choices in their profile (e.g. hometown).

yched’s picture

Note that we already have the 'radios / checkboxes' widget in D6.
I guess I'd rather have the 'smart' behavior be an option of the 'checkboxes' widget ("switch to select list if more than (user input) choices"), with no input meaning 'never'.

moshe weitzman’s picture

I am not seeing checkboxes/radio widget for node reference module in D6. Is it a matter declaring a fapi element as available for node ref?

yched’s picture

moshe: http://drupal.org/cvs?commit=127375 (this is post RC4).
I don't think I get your second sentence :-)

develcuy’s picture

StatusFileSize
new6.03 KB

this patch updates the one at #10 against 5.x-1.x-dev(from 2005-11-05).

Blessings!

joachim’s picture

There are several modules that implement funkier widgets for noderef selection:

http://drupal.org/project/nodereference_asmselect
and I saw one that showed two select lists, for 'in' and 'out' and used JS buttons to pass items from one to the other (lost the link though...)

karens’s picture

Status: Needs work » Closed (won't fix)

The D5 version is no longer being supported. Sorry.