0

I have an option field on my content types that allows you to select several items in a taxonomy vocabulary. The list has several child and parent items and it is really hard to read.

Is there a way I can add html around these checklist elements so that I can format them better with CSS?

I have attached a screenshot for more info.enter image description here

1 Answer 1

2

There is the Taxonomy Term Reference Tree module that will format terms hierarchically.

This module 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.

This module produces nested ul lists, which seems optimal for styling hierarchies, if needed.

5
  • Op isn't asking for the structure, but how to add a class around the form element so he can style them.
    – Chapabu
    Aug 12, 2013 at 9:11
  • I don't see him asking "how to add a class around the form element". He is actually asking how to add html (<li>) around the checklist items and styling that. Those are divs that already have a ton of classes that can be styled, but the initial problem seemed to be that the structure is hard to read. This module might help there. Aug 12, 2013 at 10:45
  • Ah...my mistake! Sorry, I hadn't read the module page properly!
    – Chapabu
    Aug 12, 2013 at 10:53
  • I've formatted the answer mainly so I could turn my downvote upside down :)
    – Chapabu
    Aug 12, 2013 at 10:54
  • This is perfect. Keep it simple, less coding for me the better the solution. Thanks Aug 12, 2013 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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