Problem/Motivation
We are displaying many tables inside Field Group accordions to display data for collection items in a museum. Many of the items are missing particular bits of data. We don't want to show empty tables (when there is missing data) and we don't want to show accordions that open up to reveal empty tables.
Steps to reproduce
Create a table that displays only empty fields.
Proposed resolution
Adding a 'Hide the table if empty' setting to the field formatter.
Remaining tasks
- Review patch
- Improve if necessary
User interface changes
Adds a new setting 'Hide the table if empty' with the description 'Do not output any table or container markup if there are no rows with values.'
This setting uses Field Group's field_group_remove_empty_display_groups function to abort the preRender function if the table group is empty.
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3167467-option-to-prevent-all-output-if-the-table-has-no-rows-2.patch | 1.81 KB | Phil Wolstenholme |
Comments
Comment #2
Phil Wolstenholme commentedComment #4
antonnaviHello, Phil Wolstenholme !
Thank You for help!
Comment #5
antonnavi