Browse Source

Fix endnote display when no reference link.

fix
Alexander O'Neill 6 years ago
parent
commit
29d8eecf91
  1. 19
      bibcite_footnotes.module
  2. 8
      css/reference_footnote.css

19
bibcite_footnotes.module

@ -113,16 +113,21 @@ function bibcite_footnotes_preprocess_bibcite_footnote_list(&$variables) {
} }
if ($fn['ibid']) { if ($fn['ibid']) {
$build['#type'] = 'markup'; $build['footnote-text'] = [
$build['#markup'] = ' <span class="endnote-text"><span class="ibid">' '#type' => 'markup',
'#markup' => ' <span class="endnote-text"><span class="ibid">'
. t('Ibid') . '.</span>' . t('Ibid') . '.</span>'
. (!empty($fn['page']) ? ', ' . $fn['page'] : '') . (!empty($fn['page']) ? ', ' . $fn['page'] : '')
. '</span>'; . '</span>',
];
} }
else if (!empty($fn['text']) && $variables['note_type'] == ReferenceFootnotesFilter::ENDNOTE) { else if (!empty($fn['text']) && $variables['note_type'] == ReferenceFootnotesFilter::ENDNOTE) {
$build['#type'] = 'markup';
$build['#markup'] = ' <span class="endnote-text">' . $fn['text'] . '</span>';
$build['footnote-link'] = Link::fromTextAndUrl($fn['value'], $url)->toRenderable(); $build['footnote-link'] = Link::fromTextAndUrl($fn['value'], $url)->toRenderable();
$build['footnote-text'] = [
'#type' => 'markup',
'#markup' => ' <span class="endnote-text">' . $fn['text'] . '</span>',
];
} }
if (!empty($reference_entity_id)) { 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['sort'] = trim(strip_tags(render($citation_build)));
} }
$item['#markup'] = $render; // $item['#markup'] = $render;
$notes['#items'][] = $item; $notes['#items'][] = $build;
$reference_entity_id = FALSE; $reference_entity_id = FALSE;
$render = FALSE; $render = FALSE;
} }

8
css/reference_footnote.css

@ -1,10 +1,10 @@
.footnotes .footnote .footnote-link, .footnote-list .footnotes .footnote-link,
.footnotes .footnote .footnote-multi { .footnote-list .footnotes .footnote-multi {
float: left; float: left;
} }
.footnotes .footnote .footnote-link::after, .footnote-list .footnotes .footnote-link::after,
.footnotes .footnote .footnote-multi::after { .footnote-list .footnotes .footnote-multi::after {
content: " "; content: " ";
white-space: pre; white-space: pre;
} }
Loading…
Cancel
Save