Caught between saving data and doing this on view, leaning toward on view
This commit is contained in:
parent
fdc2a0900f
commit
6cab0a02bd
1 changed files with 30 additions and 0 deletions
|
@ -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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue