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

  1. Review patch
  2. 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

Comments

Phil Wolstenholme created an issue. See original summary.

Phil Wolstenholme’s picture

Status: Active » Needs review
StatusFileSize
new1.81 KB

antonnavi’s picture

Version: 8.x-1.0-beta3 » 8.x-1.x-dev
Status: Needs review » Fixed

Hello, Phil Wolstenholme !

Thank You for help!

antonnavi’s picture

Assigned: Phil Wolstenholme » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.