Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Nice module, thanks.
Would it be possible to only display the field collection items as tabs if there is more than one item? I.e. if there is only one item leave out the tab ui?
Comment | File | Size | Author |
---|---|---|---|
#4 | field_collection_tabs-1838498-04-no-tabs-on-single-values.patch | 5.79 KB | jamsilver |
#2 | singletab.png | 10.53 KB | gaele |
#2 | Twotabs.png | 13.83 KB | gaele |
Comments
Comment #1
larowlanSo what would happen here with the title field?
Would we just not add the javascript that transforms the markup into a tabset and leave it as two unordered lists?
Comment #2
gaele CreditAttribution: gaele commentedThe title field (label) would be just a normal field item, so no list markup at all.
Single tab:
Two tabs:
Comment #3
gaele CreditAttribution: gaele commentedComment #4
jamsilver CreditAttribution: jamsilver commentedOK, I needed this functionality so here it is - patch attached!
There are two new options on the formatter config form:
1. Hide tabs for single values - withholds the tab markup or javascript if there is only a single value in the field,
2. Hide title field when tabs are hidden- withholds the title field when only a single tab-less value is shown.