diff --git a/islandora_fits.module b/islandora_fits.module index 87dd93d8..b9b55621 100644 --- a/islandora_fits.module +++ b/islandora_fits.module @@ -52,7 +52,7 @@ function islandora_fits_theme($existing, $type, $theme, $path) { 'variables' => [ 'title' => 'FITS data', 'link' => NULL, - 'data' => [], + 'output' => [], ], ], ]; diff --git a/src/Plugin/Field/FieldFormatter/FitsFormatter.php b/src/Plugin/Field/FieldFormatter/FitsFormatter.php index d4699d7a..59bd2875 100644 --- a/src/Plugin/Field/FieldFormatter/FitsFormatter.php +++ b/src/Plugin/Field/FieldFormatter/FitsFormatter.php @@ -136,12 +136,21 @@ class FitsFormatter extends FormatterBase { } } } + $fieldsets = $variables['islandora_fits_fieldsets']; + $output = []; + foreach ($fieldsets as $title => $fieldset) { + $output[] = [ + 'title' => $title, + 'data' => $fieldset, + ]; - $renderable = [ + } + + $renderable = [ '#theme' => 'fits', - '#title' => $this->t("FITS metadata"), + '#title' => $this->t("FITS metadata"), '#link' => $link, - '#data' => $variables['islandora_fits_fieldsets'], + '#output' => $output, ]; return \Drupal::service('renderer')->render($renderable); diff --git a/templates/fits.html.twig b/templates/fits.html.twig index d7ffc358..612b7d00 100644 --- a/templates/fits.html.twig +++ b/templates/fits.html.twig @@ -1,5 +1,10 @@
{{ link }}
-