Skip to content

Instantly share code, notes, and snippets.

@KalobTaulien
Created January 19, 2019 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KalobTaulien/873ec0272af82b3c3bb5d0d636636a19 to your computer and use it in GitHub Desktop.
Save KalobTaulien/873ec0272af82b3c3bb5d0d636636a19 to your computer and use it in GitHub Desktop.
Setting Up A RichText Content Area
{# templates/blog/blog_post_page.html #}
{% extends 'base.html' %}
{% load wagtailcore_tags %}
{% block content %}
{{ self.richtext|richtext }}
{% endblock content %}
"""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