-1

I'm working in modernize a old website and i saw that the use buttons for redering document's URLs.
I saw that we can import documents from draftail but i'm not sure how can we modify document's rendering to show a button instead a link as this: enter image description here

Can anyone help me?

piet.t
  • 11,718
  • 21
  • 43
  • 52
SalahAdDin
  • 2,023
  • 25
  • 51

1 Answers1

0

Buttons do not belong inside rich text content. A button is not text - it is a design element in its own right, and so you should define a specific StreamField block for that purpose.

from wagtail.core import blocks
from wagtail.documents.blocks import DocumentChooserBlock

class DocumentLinkButton(blocks.StructBlock):
    document = DocumentChooserBlock()
    button_text = blocks.CharBlock
gasman
  • 23,691
  • 1
  • 38
  • 56