Grouped Footnotes

Created on 15 October 2024, 6 months ago

Problem/Motivation

Our site uses footnotes extensively and it is a key part of our site. We love version 4.x with the improved editor interface and are excited to have the ability group footnotes for multiple text areas into a single container. This feature will enable more complex publications to be implemented.

I would like to gain a better understanding of the limitations and identify any potential workarounds for these limitations. I have read the docs and reviewed some of the code.

Our main existing publication content type currently utilizes a long text field for the "summary" at the top of the page and then a "details" section which is a paragraph field. In this details paragraph section, we may have a paragraphs for text, images, and card sections.

First off, in my tests, if I put the footnotes only in the textarea paragraphs, the grouping works as intended. This covers 90+% of our use cases.

My questions:

  1. If I put a footnote in that top summary text area (which the client does like to do from time to time), the numbering goes off the rails and one or more of the footnotes are left out of the grouping. Is there some way that I could change the structure of that non-paragraph, regular textarea field so that it is included with the paragraph's footnotes output?
  2. Is it OK to put other paragraphs that include no additional footnotes items after the "Footnotes" paragraph that has the {{ drupal_block('footnotes_group') }} twig?
  3. I see in the provided Footnotes Group block configuration, there are configs for "Group footnotes using JavaScript" and "Current entity context for for caching". Can these be implemented with {{ drupal_block('footnotes_group') }} twig tweaks method?
  4. Like a lot of sites, we have both a "Basic HTML" and a "Full HTML" text format configured. Would it work to mix the two together on a page if the footnotes config matches? That is if the first paragraph is basic and has footnotes and the second paragraph is full and has footnotes, will the footnotes all end up the in the footnotes_group block?

Thanks for all your efforts!

πŸ’¬ Support request
Status

Active

Version

4.0

Component

Footnotes

Created by

πŸ‡ΊπŸ‡ΈUnited States maddentim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @maddentim
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Thanks for the kind words, glad you like the updates!

    1. Within the block there is an option to load it with javascript, typically to handle cases where content is e.g. ajax loaded/bigpipe loaded but can help handle edge case. I'd try the regular group first though as essentially it builds up the footnotes in the order they get rendered, so the top of the page should happen first. Check with cached/non-cached versions
    2. yep no problem
    3. yep there are some examples in the twig tweak docs here https://www.drupal.org/docs/contributed-modules/twig-tweak-2x/rendering-... β†’
    4. yep, it doesn't care where the footnotes come from, essentially there is a service collecting them all from wherever they get rendered and dropping em into a bucket

    You can also take a look at the 'references shown in pop-ups' noted on the module homepage. We use footnotes for giant publications ourselves and style that to be a minimal slide up from the bottom which our users seem to like compared to a citation jumping them down to the bottom of the page - can be a nice progressive enhancement (they still show at the bottom of the page too)

  • πŸ‡ΊπŸ‡ΈUnited States maddentim

    This is all good to hear. I reviewed the twig_tweak and the src for the footnotes block, the {{ drupal_block('footnotes_group', { group_via_js: true }) }} looks easy enough.

    What I am not sure about is the cache part. Looking at the source for footnotes, I see on line 17 of the FootnotesGroupBlock.php file that we have the entity @ContextDefinition there. I am not sure how I would set that with the tweak. When I set that for the provided footnotes_block, is that saying that if I set it to "Node from URL" that if the node cache has been invalidated that the block should as well. So that it stays updated when the node changes?

    I agree on the popups for the footnotes. I showed that to the main site editor and he was interested. We are talking this afternoon to go over this stuff so I will bring that up again. Thanks!

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    I think with πŸ› Block - #lazy_builder content is empty for admin user on refresh Needs review the cache should anyways be fine (but that's not in beta5 though, its merged on 4.x)

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    I think we can probably mark this as fixed right? Question sort of answered and if you have specific issues you can raise in the issue queue for the module later

  • πŸ‡¬πŸ‡§United Kingdom scott_euser
  • πŸ‡ΊπŸ‡ΈUnited States maddentim

    Yep! Thanks for your support!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024