From 29d8eecf919c8ebfa792a379e889d24f634b1702 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Sun, 18 Nov 2018 20:14:10 -0400 Subject: [PATCH] Fix endnote display when no reference link. --- bibcite_footnotes.module | 23 ++++++++++++++--------- css/reference_footnote.css | 8 ++++---- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/bibcite_footnotes.module b/bibcite_footnotes.module index bdbd215..5162d89 100644 --- a/bibcite_footnotes.module +++ b/bibcite_footnotes.module @@ -113,16 +113,21 @@ function bibcite_footnotes_preprocess_bibcite_footnote_list(&$variables) { } if ($fn['ibid']) { - $build['#type'] = 'markup'; - $build['#markup'] = ' ' - . t('Ibid') . '.' - . (!empty($fn['page']) ? ', ' . $fn['page'] : '') - . ''; + $build['footnote-text'] = [ + '#type' => 'markup', + '#markup' => ' ' + . t('Ibid') . '.' + . (!empty($fn['page']) ? ', ' . $fn['page'] : '') + . '', + ]; } else if (!empty($fn['text']) && $variables['note_type'] == ReferenceFootnotesFilter::ENDNOTE) { - $build['#type'] = 'markup'; - $build['#markup'] = ' ' . $fn['text'] . ''; $build['footnote-link'] = Link::fromTextAndUrl($fn['value'], $url)->toRenderable(); + $build['footnote-text'] = [ + '#type' => 'markup', + '#markup' => ' ' . $fn['text'] . '', + ]; + } if (!empty($reference_entity_id)) { @@ -139,8 +144,8 @@ function bibcite_footnotes_preprocess_bibcite_footnote_list(&$variables) { $item['sort'] = trim(strip_tags(render($citation_build))); } - $item['#markup'] = $render; - $notes['#items'][] = $item; +// $item['#markup'] = $render; + $notes['#items'][] = $build; $reference_entity_id = FALSE; $render = FALSE; } diff --git a/css/reference_footnote.css b/css/reference_footnote.css index 80eff5f..2529217 100644 --- a/css/reference_footnote.css +++ b/css/reference_footnote.css @@ -1,10 +1,10 @@ -.footnotes .footnote .footnote-link, -.footnotes .footnote .footnote-multi { +.footnote-list .footnotes .footnote-link, +.footnote-list .footnotes .footnote-multi { float: left; } -.footnotes .footnote .footnote-link::after, -.footnotes .footnote .footnote-multi::after { +.footnote-list .footnotes .footnote-link::after, +.footnote-list .footnotes .footnote-multi::after { content: " "; white-space: pre; } \ No newline at end of file