Caught between saving data and doing this on view, leaning toward on view

This commit is contained in:
benjamin melançon 2019-09-28 18:32:05 -04:00
parent fdc2a0900f
commit 6cab0a02bd

View file

@ -1,3 +1,33 @@
<?php <?php
/**
* Implements hook_ENTITY_TYPE_update() for Drutopia article content.
*/
function geo_citation_article_update(Drupal\Core\Entity\EntityInterface $entity)
{
$article_type = $entity->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) {
}