From 6aafa4dfe8dcdff591600fa32d9a57360100a84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Wed, 5 Feb 2020 14:11:10 -0500 Subject: [PATCH] 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 --- web/themes/custom/geofresco/geofresco.theme | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/web/themes/custom/geofresco/geofresco.theme b/web/themes/custom/geofresco/geofresco.theme index 0c87f48..06a7f2c 100644 --- a/web/themes/custom/geofresco/geofresco.theme +++ b/web/themes/custom/geofresco/geofresco.theme @@ -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(''); + } + else { + $variables['permalink_url'] = $comment->permalink(); + } +}