Term Reference Display question

No replies
Last seen: 7 years 22 weeks ago
Joined: 2012-02-17

Hi there,

I have a term reference field on a node that is based on a taxonomy vocabulary. The taxonomy has a hierarchy of terms. When a user adds or edits a node that uses this taxonomy term reference with a select drop down widget, I would like to alter the appearance of the elements in the select widget.

Specifically I would like to only display leaves in the widget (i.e. no parent items) and they should be sorted alphabetically. I have tried various hooks to accomplish this but so far I have had no luck. Could anyone help me out and let me know what hook or hooks I would have to use and if this hook function could be placed in the template.php file of the theme that I am using or if it has to be used in its own module.

I have tried using hook_form_alter, hook_taxonomy_term_view, hook_taxonomy_term_view_alter, theme_preprocess_node, theme_field__taxonomy_term_reference but so far no luck. Any help would be greatly appreciated.


Add to playlist

Add to , or

Add to new playlist:

Add to playlist
This is a member-only feature
But, it's easy to become a member

Add to cart:

Contact us

Below are the supported keyboard shortcuts for our video player.

Start / stop video
Go to next video
Go to previous video
Increase or decrease player speed by 20%
Skip ahead or go back by 15 seconds
Jump to a percentage (2 is 20%, for example)
Toggle full screen
Videos Pricing More Search
BuildAModule Logo Icon BuildAModule Logo Icon
Become a member!
1 month
6 months
10% off
12 months
20% off
All memberships come with the following:
24 / 7 access to the entire 1800+ video library
An innovative video player with a rolling transcript
Extensive Drupal and cross-platform training
A thorough and thoughtful training style
Progress tracking
Take notes on specific video sections
Intuitive multi-user management
How many users?
Go solo with a single user, or give multiple team members access through one account and get discounts by bundling multiple users into a single membership.