1. Models.py

    from wagtail.core import blocks as streamfield_blocks
    
    
    content = StreamField(
        [
			...
            ("char_block", streamfield_blocks.CharBlock(
                required=True,
                help_text="Oh wow this is help text!!",
                min_length=10,
                max_length=50,
                template="streams/char_block.html"
            ))
        ],
    )

 

 

2. templates

 

streams/char_block.html

<div class="container">
    <div class="row">
        <col-sm-10 class="offset-sm-1">
            {{ self }}
        </col-sm-10>
    </div>
</div>

'Back-End > Wagtail, Django' 카테고리의 다른 글

Wagtail Changing the Admin Display Title  (0) 2021.12.03
Wagtail Routable  (0) 2021.12.03
Wagtail Custom Page Properties  (0) 2021.12.02
Wagtail Custom Admin Tabs  (0) 2021.12.01
Wagtail Tags  (0) 2021.12.01

+ Recent posts