2

I have a content type with a term reference field (check boxes widget, vocabulary: Category) from which every user has to choose one term to be attached to his node.

I have also added an image field to the Category vocabulary to attach a default image to each term.

How can i display the term images and the term names instead of only the term names in the term selection process when creating the node? Is there a module out there?

Or maybe using hook form alter. Any guidelines?

1

Ok so after doing some research i found the Entity Reference View Widget being a very cool module to achieve this. Basically with this module you can use a view to select items (imagine that!).

For my purpose i had to patch the module in order to have fields (instead of only rendered entities) as the view's format to show. The fields i used in my view were the term image, the term name and the Entity Reference View Widget Checkbox field (coming from the patch). The patch has an extra feature which lets you choose radios instead of checkboxes if someone wants to restrict the selection to 1.

After building the view you can manage the display of your selection through the "Manage Display" process of the fields of your content type like any other field.

I think this module has great potential. Try it out.

1

Looks like the Taxonomy Term Reference Tree Widget module gives you the ability to add images to term references. Here is a quote about it (from the module's project page):

... provides an expandable tree widget for the Taxonomy Term Reference field in Drupal 7. This widget is intended to serve as a replacement for Drupal's core Taxonomy Term Reference widget, which is a flat list of radio buttons or checkboxes and not necessarily fit for medium to large taxonomy trees.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.