Skip to content

render footnotes generated in richtextblock #47

@DBonbon

Description

@DBonbon

How to name/ refer to footnotes in a block
In models.py I can generate footnotes as expected. Yet, if I use the same block it doesn't render the note. That is, I create and populates the notes in Admin, in the template they appear with the Admin with system's ref, and the footnotes section is empty - {% include "wagtail_footnotes/includes/footnotes.html" %}.

class Notes1Page(Page):
    body = StreamField([
        ('fnotes', RichTextBlockWithFootnotes(label=("Feature type"), blank=True, default='abc',)),
    ])    ...

    content_panels = Page.content_panels + [
        FieldPanel('body', classname='full'),        ...
    ]

this above works, but the below doesn't:

class ColumnBlock(blocks.StreamBlock):

    paragraph = blocks.wagtail_footnotes.blocks.RichTextBlockWithFootnotes(editor='full', label='Paragraphe') 
    # error: 'wagtail.core.blocks' has no attribute 'wagtail_footnotes'
    paragraph1 = blocks.RichTextBlock(editor='full', label='Paragraphe')    #full' is defined in WAGTAILADMIN_RICH_TEXT_EDITORS/base.py, 
    paragraph2 = blocks.RichTextBlock(features=["bold", "italic", "link", "footnotes"], required=False, label='Paragraphe2') 
    
    paragraph3 = RichTextBlockWithFootnotes(features=["bold", "italic", "footnotes"], required=False, label='Paragraphe Notes1')
#Paragraph1-3 generate footnotes in the Admin, but don't render them in the template.
    ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions