Browse Source

its twiggy now

pull/907/head
Alan Stanley 7 years ago
parent
commit
ef4d861320
  1. 2
      config/install/system.action.generate_a_technical_metadata_derivative.yml
  2. 14
      islandora_fits.module
  3. 8
      src/Plugin/Field/FieldFormatter/FitsFormatter.php
  4. 4
      templates/fits.html.twig

2
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'

14
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' => [],
],
],
];
}

8
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);
}
/**

4
templates/fits.html.twig

@ -0,0 +1,4 @@
<h1>{{ title }}</h1>
<div>{{ data }}</div>
Loading…
Cancel
Save