diff --git a/config/install/system.action.generate_a_technical_metadata_derivative.yml b/config/install/system.action.generate_a_technical_metadata_derivative.yml index 7c64d8e6..82a9edde 100644 --- a/config/install/system.action.generate_a_technical_metadata_derivative.yml +++ b/config/install/system.action.generate_a_technical_metadata_derivative.yml @@ -14,6 +14,6 @@ configuration: derivative_term_uri: 'https://projects.iq.harvard.edu/fits' mimetype: application/xml args: null - destination_media_type: file + destination_media_type: fits_technical_metadata scheme: public path: '[date:custom:Y]-[date:custom:m]/[node:nid]-[term:name].xml' diff --git a/islandora_fits.module b/islandora_fits.module index 29609d76..916096b7 100644 --- a/islandora_fits.module +++ b/islandora_fits.module @@ -42,3 +42,17 @@ function islandora_fits_install() { ))->save(); } } + +/** + * Implements hook_theme(). + */ +function islandora_fits_theme($existing, $type, $theme, $path) { + return [ + 'fits' => [ + 'variables' => [ + 'title' => 'FITS data', + 'data' => [], + ], + ], + ]; +} diff --git a/src/Plugin/Field/FieldFormatter/FitsFormatter.php b/src/Plugin/Field/FieldFormatter/FitsFormatter.php index 4f0259e2..8e9fa63e 100644 --- a/src/Plugin/Field/FieldFormatter/FitsFormatter.php +++ b/src/Plugin/Field/FieldFormatter/FitsFormatter.php @@ -131,8 +131,12 @@ class FitsFormatter extends FormatterBase { } } - $output = $variables['islandora_fits_fieldsets']; - return render($output); + $renderable = [ + '#theme' => 'fits', + '#data' => $variables['islandora_fits_fieldsets'], + '#title' => $this->t("Fits Metadata"), + ]; + return \Drupal::service('renderer')->render($renderable); } /** diff --git a/templates/fits.html.twig b/templates/fits.html.twig new file mode 100644 index 00000000..33bb8bda --- /dev/null +++ b/templates/fits.html.twig @@ -0,0 +1,4 @@ +

{{ title }}

+
{{ data }}
+ +