Provide a "footnotes" block collecting all definitions present on a page

Created on 30 June 2023, over 1 year ago
Updated 30 July 2023, over 1 year ago

Problem/Motivation

There is a need for all DFN links present on a page, possibly from multiple nodes, to be gathered and displayed as a list of "footnotes", with backlinks going back from the list to the DFN link, in order to provide more discoverability to the glossary entries, beyond what just the <a> links provide, even with tooltips, because those require user interaction.

This is actually a request from the French government client funding the D10/D9 port.

Steps to reproduce

  • create a couple of G2 entries
  • enable the G2 definition filter in the body format
  • create a couple of non-G2 nodes, with their body containing DFN links
  • navigate to the site home, seeing these nodes with their links
  • with this feature, there could be a "definitions" block in the footer or sidebar, listing and deduplicating all these links in a unique location

Proposed resolution

Currently, the Definition filter tags all links it generates with a g2-dfn-link class.

This enables JS code to handle most of the work of collecting, deduplicating, and back-and-forth linking between the links and a collecting blogk.

This would be significantly more difficult in PHP code, due to the filtering being cached and not providing any context (for better cacheability).

  • create a footnotes block
  • in this block, attach a new footnotes library
  • in that library, add JS (maybe jQuery) code collecting the links, deduplicating them, and adding the links

Remaining tasks

  • design the block
  • code the feature in JS
  • document it in help and README

User interface changes

  • a new block collecting DFN as footnotes
  • a new view display to define how footnotes are formatted
  • each DFN link has a forward link to the footnotes block and a generated ID
  • each footnote in the list has one or more (in case of duplication) links back to the DFN link

API changes

None.

Data model changes

None.

Feature request
Status

Fixed

Version

1.0

Component

User interface

Created by

🇫🇷France fgm Paris, France

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

Comments & Activities

Production build 0.71.5 2024