From 6cab0a02bd903bdbfd107011f01a2136d6fa185c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Sat, 28 Sep 2019 18:32:05 -0400 Subject: [PATCH] Caught between saving data and doing this on view, leaning toward on view --- .../custom/geo_citation/geo_citation.module | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/web/modules/custom/geo_citation/geo_citation.module b/web/modules/custom/geo_citation/geo_citation.module index 50cce95..cda6778 100644 --- a/web/modules/custom/geo_citation/geo_citation.module +++ b/web/modules/custom/geo_citation/geo_citation.module @@ -1,3 +1,33 @@ field_article_type->getValue(); + // If it's not a GEO Original article, there's nothing for us to do. + if (!$article_type == 6) { + return; + } +} +/** + * Implements hook_entity_extra_field_info(). + */ +function geo_citation_entity_extra_field_info() { + $extra = []; + $extra['node']['article']['display']['geo_citation'] = [ + 'label' => t('GEO Citation'), + 'description' => t('Re-presents title, author, date and other information in a standard citeable format.'), + 'weight' => 90, + ]; + return $extra; +} + +/** + * Implements hook_ENTITY_TYPE_view() for Drutopia articles. + */ +function geo_citation_article_view(array &$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode) { + +}