Footnotes
Provides automatically numbered footnote references for CKEditor 5 with citations, backlinks, and customizable grouping options.
footnotes
概要
Footnotesモジュールは、コンテンツ編集者がURLへの参照や学術的な引用など、記事や投稿に自動番号付きの脚注参照を簡単に作成できるようにします。CKEditor 5のツールバーボタンを提供し、モーダルウィンドウを開いて脚注ソース内に書式付きコンテンツ(太字、斜体、リンク)を追加できます。
このモジュールはテキスト内に引用(例:[1]、[2])を自動的に作成し、コンテンツの下部に脚注参照セクションを生成します。各引用は対応する参照にリンクし、バックリンクによりユーザーはテキスト内の引用箇所に戻ることができます。複数の引用が同じ脚注を参照でき、同一の脚注は単一の参照番号に統合できます。
複数のテキストフィールドを持つ複雑なレイアウト用に、ページ内のすべての脚注を収集して単一の統合参照セクションに表示するFootnotes Groupブロックを提供します。また、Search APIと統合して引用マーカーを検索インデックスから除外します。
Features
- モーダルダイアログインターフェースで脚注を挿入するためのCKEditor 5ツールバーボタン
- カスタマイズ可能な手動値を持つ自動脚注番号付け
- 参照セクションにジャンプする引用リンクと引用箇所に戻るバックリンク
- アルファベットサフィックス(1a、1b、1c)を持つ同一脚注への複数引用のサポート
- 同一の脚注コンテンツを単一の参照番号に統合するオプション
- 複数のテキストフィールドからの脚注を1つの参照セクションに統合するFootnotes Groupブロック
- 遅延読み込みコンテンツシナリオ用のJavaScriptベースのグループ化
- 参照セクションにジャンプする代わりにポップアップで脚注コンテンツを表示するダイアログモードオプション
- 検索インデックスから脚注引用を除外するSearch APIプロセッサ
- Footnotes 3.xから4.x形式へのコンテンツアップグレード用Drushコマンド
- 引用、引用グループ、参照リスト用のテーマ可能なテンプレート
- ツールバー設定のCKEditor 4からCKEditor 5への自動アップグレードパス
- Microsoft WordおよびLibreOfficeドキュメントからの脚注貼り付けのサポート
Use Cases
Academic or research articles with citations
Use footnotes to add source citations to academic content. Each citation gets an automatic number that links to the full reference at the bottom of the article. Readers can click citations to see references and use backlinks to return to their reading position.
Legal documents with references
Legal content often requires numbered references to laws, court cases, or other documents. The footnotes module provides automatic numbering and can collapse identical references to the same number when the same source is cited multiple times.
Long-form articles with explanatory notes
Journalists and content writers can use footnotes to add clarifying information without interrupting the main narrative. Enable the dialog option to show footnote content in a popup instead of jumping to the bottom of the page.
Pages with multiple content sections
For pages that combine content from multiple fields (like body text and sidebar content), use the Footnotes Group block to collect all footnotes into a single consolidated reference section. Place the block after the main content area.
Content with lazy-loaded components
When footnotes appear in lazy-loaded content (like AJAX-loaded sections), enable the 'Group footnotes using JavaScript' option in the Footnotes Group block to ensure all footnotes are captured and properly numbered.
Migrating content from other systems
Content pasted from Microsoft Word or LibreOffice that contains footnotes can be handled by the module. Use the debug mode (add ?debug=1 to the URL) to troubleshoot paste issues. The Drush upgrade command handles migration from Footnotes 3.x format.
Tips
- Copy templates to your theme directory and clear the theme registry cache (drush cc theme-registry) to customize footnote appearance
- Use the 'Collapse footnotes with identical content' option to automatically combine duplicate citations into the same reference number
- When using the Footnotes Group block, set the entity context to 'node' to ensure proper cache invalidation
- For academic content, consider enabling the dialog option to improve user experience by showing references in a popup
- Test the upgrade Drush command thoroughly on development/staging before running on production content
Technical Details
Admin Pages 2
/admin/config/content/formats/manage/{format}
Configure the Footnotes filter settings for a specific text format. Access this by editing any text format that has the Footnotes filter enabled.
/admin/config/content/formats/manage/{format}
Configure the CKEditor toolbar used within the Footnotes modal dialog. This uses the special 'Footnote' text format.
Hooks 1
hook_footnotes_upgrade_3x4x_build_alter
Alter the render array used to produce an upgraded footnote tag when upgrading content from 3.x to 4.x format.
Drush Commands 1
drush footnotes:upgrade-3-to-4 <entity_type>
Upgrades footnote content from 3.x format (<fn> and [fn] tags) to 4.x format (<footnotes> tags with data attributes). Processes all entities of the specified type that contain formatted text fields with footnotes.
Troubleshooting 6
Ensure the Footnotes filter is enabled in your text format and appears before HTML correction filters. Clear the cache after making configuration changes.
The Footnotes filter should appear before the 'Convert line breaks' filter in the filter order. The module uses a custom spaceless Twig filter to minimize whitespace.
Enable the 'Group footnotes using JavaScript' option in the Footnotes Group block configuration. Do not disable the footnotes footer output when using this option.
Add ?debug=1 to your page URL before pasting to see console output. Check that the pasted content contains recognizable footnote markers.
Clear all caches after changing the 'Disable output of the footnotes footer' setting. This setting affects how content is rendered and cached.
This is a Drupal Core limitation - modal windows within modal windows are not supported. Use links instead of embedded media within footnotes.
Security Notes 3
- The module has official Drupal security coverage
- Footnote content is filtered through the 'footnote' text format which limits allowed HTML tags to br, p, strong, em, and links
- Access to the footnotes dialog requires the 'use text format footnote' permission