Created
January 19, 2019 21:02
-
-
Save KalobTaulien/873ec0272af82b3c3bb5d0d636636a19 to your computer and use it in GitHub Desktop.
Setting Up A RichText Content Area
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# templates/blog/blog_post_page.html #} | |
{% extends 'base.html' %} | |
{% load wagtailcore_tags %} | |
{% block content %} | |
{{ self.richtext|richtext }} | |
{% endblock content %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Blog page in blog/models.py.""" | |
from wagtail.admin.edit_handlers import FieldPanel, RichTextField | |
from wagtail.core.models import Page | |
class BlogPostPage(Page): | |
"""A blog page class. This is a demo class.""" | |
template = "blog/blog_post_page.html" | |
richtext = RichTextField() | |
content_panels = ( | |
FieldPanel("title", classname="full title"), | |
FieldPanel("richtext"), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment