Output permalink URLs to allow remix of date as permalink

Ref https://gitlab.com/drutopia/drutopia/issues/283

This will move into Octavia or even Bulma theme ideally
This commit is contained in:
benjamin melançon 2020-02-05 14:11:10 -05:00
parent 8e80118041
commit 6aafa4dfe8

View file

@ -26,3 +26,18 @@ function geofresco_preprocess_page_title(&$variables) {
} }
} }
} }
/**
* Implements hook_preprocess_HOOK() for comment.
*
* Shortens and stacks username and submitted date.
*/
function geofresco_preprocess_comment(array &$variables) {
$comment = $variables['elements']['#comment'];
if (isset($comment->in_preview)) {
$variables['permalink_url'] = new Url('<front>');
}
else {
$variables['permalink_url'] = $comment->permalink();
}
}