Browse Source

Remove unnecessary field panels, add more example blocks

Jeremy Childers 1 month ago
parent
commit
4e88b05bf4

+ 13 - 2
coderedcms/blocks/__init__.py

@@ -60,7 +60,12 @@ from .stream_form_blocks import CoderedStreamFormTimeFieldBlock
 # Collections of blocks commonly used together.
 
 HTML_STREAMBLOCKS = [
-    ("text", RichTextBlock(icon="cr-font")),
+    (
+        "text",
+        RichTextBlock(
+            icon="cr-font",
+        ),
+    ),
     ("button", ButtonBlock()),
     ("image", ImageBlock()),
     ("image_link", ImageLinkBlock()),
@@ -70,6 +75,8 @@ HTML_STREAMBLOCKS = [
             icon="code",
             form_classname="monospace",
             label=_("HTML"),
+            description="Raw html content.",
+            preview_value="<h1>Raw html</h1><table class='table'><tr><td>Table in html</td></tr></table>",
         ),
     ),
     ("download", DownloadBlock()),
@@ -143,7 +150,11 @@ LAYOUT_STREAMBLOCKS = [
     (
         "html",
         blocks.RawHTMLBlock(
-            icon="code", form_classname="monospace", label=_("HTML")
+            icon="code",
+            form_classname="monospace",
+            label=_("HTML"),
+            description="Raw html content.",
+            preview_value="<h1>Raw html</h1><table class='table'><tr><td>Table in html</td></tr></table>",
         ),
     ),
 ]

+ 42 - 0
coderedcms/blocks/content_blocks.py

@@ -64,6 +64,15 @@ class CardBlock(BaseBlock):
         template = "coderedcms/blocks/card_foot.html"
         icon = "cr-list-alt"
         label = _("Card")
+        description = (
+            "A component of information with image, text, and buttons."
+        )
+        preview_value = {
+            "settings": {"custom_template": ""},
+            "title": "Preview Card",
+            "subtitle": "Optional Subtitle",
+            "description": "Card content, which is rich text formatable.",
+        }
 
 
 class CarouselBlock(BaseBlock):
@@ -302,6 +311,39 @@ class PriceListBlock(BaseBlock):
         template = "coderedcms/blocks/pricelist_block.html"
         icon = "cr-usd"
         label = _("Price List")
+        preview_value = {
+            "settings": {"custom_template": ""},
+            "heading": "Example Price List",
+            "items": [
+                (
+                    "item",
+                    {
+                        "settings": {"custom_template": ""},
+                        "name": "Price 1",
+                        "description": "An example price",
+                        "price": "$10/month",
+                    },
+                ),
+                (
+                    "item",
+                    {
+                        "settings": {"custom_template": ""},
+                        "name": "Price 2",
+                        "description": "An example price",
+                        "price": "$100/year",
+                    },
+                ),
+                (
+                    "item",
+                    {
+                        "settings": {"custom_template": ""},
+                        "name": "Price 3",
+                        "description": "An example price",
+                        "price": "$1/day",
+                    },
+                ),
+            ],
+        }
 
 
 class ContentWallBlock(BaseBlock):

+ 58 - 0
coderedcms/blocks/html_blocks.py

@@ -37,6 +37,13 @@ class ButtonBlock(ButtonMixin, BaseLinkBlock):
         icon = "cr-hand-pointer-o"
         label = _("Button Link")
         value_class = LinkStructValue
+        preview_value = {
+            "settings": {"custom_template": ""},
+            "button_title": "Example Button",
+            "other_link": "https://www.example.com",
+            "button_style": "btn-primary",
+            "button_size": "",
+        }
 
 
 class DownloadBlock(ButtonMixin, BaseBlock):
@@ -96,6 +103,12 @@ class EmbedGoogleMapBlock(BaseBlock):
         template = "coderedcms/blocks/google_map.html"
         icon = "cr-map"
         label = _("Google Map")
+        preview_value = {
+            "settings": {"custom_template": ""},
+            "map_title": "Codered Headquarters",
+            "place_id": "ChIJWYxmGn7wMIgRf_Jq3ivHAsM",
+            "map_zoom_level": 14,
+        }
 
 
 class EmbedVideoBlock(BaseBlock):
@@ -131,6 +144,8 @@ class H1Block(BaseBlock):
         template = "coderedcms/blocks/h1_block.html"
         icon = "cr-header"
         label = _("Heading 1")
+        description = "An <h1> heading."
+        preview_value = "An H1 Heading."
 
 
 class H2Block(BaseBlock):
@@ -147,6 +162,8 @@ class H2Block(BaseBlock):
         template = "coderedcms/blocks/h2_block.html"
         icon = "cr-header"
         label = _("Heading 2")
+        description = "An <h2> heading."
+        preview_value = "An H2 Heading."
 
 
 class H3Block(BaseBlock):
@@ -163,6 +180,8 @@ class H3Block(BaseBlock):
         template = "coderedcms/blocks/h3_block.html"
         icon = "cr-header"
         label = _("Heading 3")
+        description = "An <h3> heading."
+        preview_value = "An H3 Heading."
 
 
 class TableBlock(BaseBlock):
@@ -237,6 +256,17 @@ class PageListBlock(BaseBlock):
         template = "coderedcms/blocks/pagelist_block.html"
         icon = "list-ul"
         label = _("Latest Pages")
+        description = "Renders a preview of selected pages."
+        preview_value = {"settings": {"custom_template": ""}}
+
+    def get_preview_value(self):
+        from wagtail.models import Page
+
+        val = super().get_preview_value()
+        val["indexed_by"] = Page.objects.live().first()
+        val["num_posts"] = 3
+
+        return val
 
     def get_context(self, value, parent_context=None):
         context = super().get_context(value, parent_context=parent_context)
@@ -286,6 +316,26 @@ class PagePreviewBlock(BaseBlock):
         template = "coderedcms/blocks/pagepreview_block.html"
         icon = "doc-empty-inverse"
         label = _("Page Preview")
+        description = "Renders a preview of a specific page."
+        preview_value = ""
+        preview_template = (
+            "coderedcms/previews/blocks/pagepreview_block_preview.html"
+        )
+
+    def get_preview_value(self):
+        from wagtail.models import Page
+
+        return {
+            "settings": {"custom_template": ""},
+            "page": Page.objects.live().first(),
+        }
+
+    def get_preview_context(self, value, parent_context=None):
+        ctx = super().get_preview_context(value, parent_context)
+        value = self.get_preview_value()
+        ctx["page"] = value.get("page")
+
+        return ctx
 
 
 class QuoteBlock(BaseBlock):
@@ -308,8 +358,16 @@ class QuoteBlock(BaseBlock):
         template = "coderedcms/blocks/quote_block.html"
         icon = "openquote"
         label = _("Quote")
+        description = "A <blockquote>."
+        preview_value = {
+            "settings": {"custom_template": ""},
+            "text": "A block quote example.",
+            "author": "Codered",
+        }
 
 
 class RichTextBlock(blocks.RichTextBlock):
     class Meta:
         template = "coderedcms/blocks/rich_text_block.html"
+        description = ("Rich text content.",)
+        preview_value = "<h1>Some Sample Text!</h1><br><p>It is able to be <i>Italic</i> and <b>bold</b> as well."

+ 28 - 4
coderedcms/blocks/layout_blocks.py

@@ -34,7 +34,6 @@ class ColumnBlock(BaseLayoutBlock):
         template = "coderedcms/blocks/column_block.html"
         icon = "placeholder"
         label = "Column"
-        preview_template = "wagtailcore/shared/block_preview.html"
         description = "Renders the content in a column."
         preview_value = (
             {
@@ -60,7 +59,6 @@ class GridBlock(BaseLayoutBlock):
         template = "coderedcms/blocks/grid_block.html"
         icon = "cr-columns"
         label = _("Responsive Grid Row")
-        preview_template = "wagtailcore/shared/block_preview.html"
         description = "Renders a row of columns."
         preview_value = {
             "settings": {
@@ -106,6 +104,33 @@ class CardGridBlock(BaseLayoutBlock):
         template = "coderedcms/blocks/cardgrid_deck.html"
         icon = "cr-th-large"
         label = _("Card Grid")
+        description = "Renders a row of cards."
+        preview_value = {
+            "settings": {"custom_template": ""},
+            "content": [
+                (
+                    "card",
+                    {
+                        "settings": {"custom_template": ""},
+                        "title": "Card 1",
+                    },
+                ),
+                (
+                    "card",
+                    {
+                        "settings": {"custom_template": ""},
+                        "title": "Card 2",
+                    },
+                ),
+                (
+                    "card",
+                    {
+                        "settings": {"custom_template": ""},
+                        "title": "Card 3",
+                    },
+                ),
+            ],
+        }
 
 
 class HeroBlock(BaseLayoutBlock):
@@ -148,6 +173,7 @@ class HeroBlock(BaseLayoutBlock):
         template = "coderedcms/blocks/hero_block.html"
         icon = "cr-newspaper-o"
         label = "Hero Unit"
+        description = "Wrapper with color and image background options."
         preview_value = {
             "settings": {
                 "custom_template": "",
@@ -178,5 +204,3 @@ class HeroBlock(BaseLayoutBlock):
                 )
             ],
         }
-        preview_template = "wagtailcore/shared/block_preview.html"
-        description = "Wrapper with color and image background options."

+ 46 - 46
coderedcms/models/page_models.py

@@ -323,7 +323,7 @@ class CoderedPage(WagtailCacheMixin, SeoMixin, Page, metaclass=CoderedPageMeta):
     ###############
 
     content_panels = Page.content_panels + [
-        FieldPanel("cover_image"),
+        "cover_image",
     ]
 
     body_content_panels = []
@@ -332,19 +332,19 @@ class CoderedPage(WagtailCacheMixin, SeoMixin, Page, metaclass=CoderedPageMeta):
 
     classify_panels = [
         FieldPanel("classifier_terms", widget=ClassifierSelectWidget()),
-        FieldPanel("tags"),
+        "tags",
     ]
 
     layout_panels = [
         MultiFieldPanel(
-            [FieldPanel("custom_template")], heading=_("Visual Design")
+            ["custom_template"], heading=_("Visual Design")
         ),
         MultiFieldPanel(
             [
-                FieldPanel("index_show_subpages"),
-                FieldPanel("index_num_per_page"),
-                FieldPanel("index_order_by_classifier"),
-                FieldPanel("index_order_by"),
+                "index_show_subpages",
+                "index_num_per_page",
+                "index_order_by_classifier",
+                "index_order_by",
                 FieldPanel(
                     "index_classifiers", widget=forms.CheckboxSelectMultiple()
                 ),
@@ -353,9 +353,9 @@ class CoderedPage(WagtailCacheMixin, SeoMixin, Page, metaclass=CoderedPageMeta):
         ),
         MultiFieldPanel(
             [
-                FieldPanel("related_show"),
-                FieldPanel("related_num"),
-                FieldPanel("related_classifier_term"),
+                "related_show",
+                "related_num",
+                "related_classifier_term",
             ],
             heading=_("Related Pages"),
         ),
@@ -364,7 +364,7 @@ class CoderedPage(WagtailCacheMixin, SeoMixin, Page, metaclass=CoderedPageMeta):
     promote_panels = SeoMixin.seo_meta_panels
 
     settings_panels = Page.settings_panels + [
-        FieldPanel("content_walls"),
+        "content_walls",
     ]
 
     integration_panels = []
@@ -677,7 +677,7 @@ class CoderedWebPage(CoderedPage):
 
     # Panels
     body_content_panels = [
-        FieldPanel("body"),
+        "body",
     ]
 
     @property
@@ -818,12 +818,12 @@ class CoderedArticlePage(CoderedWebPage):
     ]
 
     content_panels = CoderedWebPage.content_panels + [
-        FieldPanel("caption"),
+        "caption",
         MultiFieldPanel(
             [
-                FieldPanel("author"),
-                FieldPanel("author_display"),
-                FieldPanel("date_display"),
+                "author",
+                "author_display",
+                "date_display",
             ],
             _("Publication Info"),
         ),
@@ -868,8 +868,8 @@ class CoderedEventPage(CoderedWebPage, BaseEvent):
     content_panels = CoderedWebPage.content_panels + [
         MultiFieldPanel(
             [
-                FieldPanel("calendar_color"),
-                FieldPanel("address"),
+                "calendar_color",
+                "address",
             ],
             heading=_("Event information"),
         ),
@@ -1128,8 +1128,8 @@ class CoderedEventIndexPage(CoderedWebPage):
     layout_panels = CoderedWebPage.layout_panels + [
         MultiFieldPanel(
             [
-                FieldPanel("default_calendar_view"),
-                FieldPanel("event_style"),
+                "default_calendar_view",
+                "event_style",
             ],
             heading=_("Calendar Style"),
         )
@@ -1336,22 +1336,22 @@ class CoderedFormMixin(models.Model):
     body_content_panels = [
         MultiFieldPanel(
             [
-                FieldPanel("thank_you_page"),
-                FieldPanel("button_text"),
-                FieldPanel("button_style"),
-                FieldPanel("button_size"),
-                FieldPanel("button_css_class"),
-                FieldPanel("form_css_class"),
-                FieldPanel("form_id"),
+                "thank_you_page",
+                "button_text",
+                "button_style",
+                "button_size",
+                "button_css_class",
+                "form_css_class",
+                "form_id",
             ],
             _("Form Settings"),
         ),
         MultiFieldPanel(
             [
-                FieldPanel("save_to_database"),
-                FieldPanel("to_address"),
-                FieldPanel("reply_address"),
-                FieldPanel("subject"),
+                "save_to_database",
+                "to_address",
+                "reply_address",
+                "subject",
             ],
             _("Form Submissions"),
         ),
@@ -1362,15 +1362,15 @@ class CoderedFormMixin(models.Model):
             [
                 FieldRowPanel(
                     [
-                        FieldPanel("form_golive_at"),
-                        FieldPanel("form_expire_at"),
+                        "form_golive_at",
+                        "form_expire_at",
                     ],
                     classname="label-above",
                 ),
             ],
             _("Form Scheduled Publishing"),
         ),
-        FieldPanel("spam_protection"),
+        "spam_protection",
     ]
 
     @property
@@ -1813,7 +1813,7 @@ class CoderedStreamFormPage(
     encoder = StreamFormJSONEncoder
 
     body_content_panels = (
-        [FieldPanel("form_fields")]
+        ["form_fields"]
         + CoderedFormMixin.body_content_panels
         + [InlinePanel("confirmation_emails", label=_("Confirmation Emails"))]
     )
@@ -1908,16 +1908,16 @@ class CoderedLocationPage(CoderedWebPage):
     )
 
     content_panels = CoderedWebPage.content_panels + [
-        FieldPanel("address"),
-        FieldPanel("website"),
-        FieldPanel("phone_number"),
+        "address",
+        "website",
+        "phone_number",
     ]
 
     layout_panels = CoderedWebPage.layout_panels + [
         MultiFieldPanel(
             [
-                FieldPanel("map_title"),
-                FieldPanel("map_description"),
+                "map_title",
+                "map_description",
             ],
             heading=_("Map Layout"),
         ),
@@ -1926,9 +1926,9 @@ class CoderedLocationPage(CoderedWebPage):
     settings_panels = CoderedWebPage.settings_panels + [
         MultiFieldPanel(
             [
-                FieldPanel("auto_update_latlng"),
-                FieldPanel("latitude"),
-                FieldPanel("longitude"),
+                "auto_update_latlng",
+                "latitude",
+                "longitude",
             ],
             heading=_("Location Settings"),
         ),
@@ -2037,9 +2037,9 @@ class CoderedLocationIndexPage(CoderedWebPage):
     layout_panels = CoderedWebPage.layout_panels + [
         MultiFieldPanel(
             [
-                FieldPanel("center_latitude"),
-                FieldPanel("center_longitude"),
-                FieldPanel("zoom"),
+                "center_latitude",
+                "center_longitude",
+                "zoom",
             ],
             heading=_("Map Display"),
         ),

+ 44 - 41
coderedcms/models/snippet_models.py

@@ -69,9 +69,9 @@ class Carousel(ClusterableModel):
         MultiFieldPanel(
             heading=_("Slider"),
             children=[
-                FieldPanel("name"),
-                FieldPanel("show_controls"),
-                FieldPanel("show_indicators"),
+                "name",
+                "show_controls",
+                "show_indicators",
             ],
         ),
         InlinePanel("carousel_slides", label=_("Slides")),
@@ -127,11 +127,11 @@ class CarouselSlide(Orderable, models.Model):
     )
 
     panels = [
-        FieldPanel("image"),
-        FieldPanel("background_color"),
-        FieldPanel("custom_css_class"),
-        FieldPanel("custom_id"),
-        FieldPanel("content"),
+        "image",
+        "background_color",
+        "custom_css_class",
+        "custom_id",
+        "content",
     ]
 
 
@@ -158,7 +158,7 @@ class Classifier(ClusterableModel):
     )
 
     panels = [
-        FieldPanel("name"),
+        "name",
         InlinePanel("terms", label=_("Classifier Terms")),
     ]
 
@@ -206,7 +206,7 @@ class ClassifierTerm(Orderable, models.Model):
     )
 
     panels = [
-        FieldPanel("name"),
+        "name",
     ]
 
     def save(self, *args, **kwargs):
@@ -238,7 +238,7 @@ class FilmStrip(ClusterableModel):
     )
 
     panels = [
-        FieldPanel("name"),
+        "name",
         InlinePanel("film_panels", label=_("Panels")),
     ]
 
@@ -292,12 +292,12 @@ class FilmPanel(Orderable, models.Model):
     )
 
     panels = [
-        FieldPanel("background_image"),
-        FieldPanel("background_color"),
-        FieldPanel("foreground_color"),
-        FieldPanel("custom_css_class"),
-        FieldPanel("custom_id"),
-        FieldPanel("content"),
+        "background_image",
+        "background_color",
+        "foreground_color",
+        "custom_css_class",
+        "custom_id",
+        "content",
     ]
 
 
@@ -332,15 +332,15 @@ class Navbar(models.Model):
     )
 
     panels = [
-        FieldPanel("name"),
+        "name",
         MultiFieldPanel(
             [
-                FieldPanel("custom_css_class"),
-                FieldPanel("custom_id"),
+                "custom_css_class",
+                "custom_id",
             ],
             heading=_("Attributes"),
         ),
-        FieldPanel("menu_items"),
+        "menu_items",
     ]
 
     def __str__(self):
@@ -378,15 +378,15 @@ class Footer(models.Model):
     )
 
     panels = [
-        FieldPanel("name"),
+        "name",
         MultiFieldPanel(
             [
-                FieldPanel("custom_css_class"),
-                FieldPanel("custom_id"),
+                "custom_css_class",
+                "custom_id",
             ],
             heading=_("Attributes"),
         ),
-        FieldPanel("content"),
+        "content",
     ]
 
     def __str__(self):
@@ -414,7 +414,10 @@ class ReusableContent(models.Model):
         use_json_field=True,
     )
 
-    panels = [FieldPanel("name"), FieldPanel("content")]
+    panels = [
+        "name",
+        "content",
+    ]
 
     def __str__(self):
         return self.name
@@ -437,7 +440,7 @@ class Accordion(ClusterableModel):
         MultiFieldPanel(
             heading=_("Accordion"),
             children=[
-                FieldPanel("name"),
+                "name",
             ],
         ),
         InlinePanel("accordion_panels", label=_("Panels")),
@@ -479,10 +482,10 @@ class AccordionPanel(Orderable, models.Model):
     )
 
     panels = [
-        FieldPanel("custom_css_class"),
-        FieldPanel("custom_id"),
-        FieldPanel("name"),
-        FieldPanel("content"),
+        "custom_css_class",
+        "custom_id",
+        "name",
+        "content",
     ]
 
 
@@ -520,13 +523,13 @@ class ContentWall(models.Model):
     panels = [
         MultiFieldPanel(
             [
-                FieldPanel("name"),
-                FieldPanel("is_dismissible"),
-                FieldPanel("show_once"),
+                "name",
+                "is_dismissible",
+                "show_once",
             ],
             heading=_("Content Wall"),
         ),
-        FieldPanel("content"),
+        "content",
     ]
 
     def __str__(self):
@@ -584,12 +587,12 @@ class CoderedEmail(ClusterableModel):
     panels = [
         MultiFieldPanel(
             [
-                FieldPanel("to_address"),
-                FieldPanel("from_address"),
-                FieldPanel("cc_address"),
-                FieldPanel("bcc_address"),
-                FieldPanel("subject"),
-                FieldPanel("body"),
+                "to_address",
+                "from_address",
+                "cc_address",
+                "bcc_address",
+                "subject",
+                "body",
             ],
             _("Email Message"),
         ),

+ 21 - 21
coderedcms/models/wagtailsettings_models.py

@@ -148,13 +148,13 @@ class LayoutSettings(ClusterableModel, BaseSiteSetting):
     navbar_panels = [
         MultiFieldPanel(
             [
-                FieldPanel("navbar_color_scheme"),
-                FieldPanel("navbar_class"),
-                FieldPanel("navbar_fixed"),
-                FieldPanel("navbar_content_fluid"),
-                FieldPanel("navbar_collapse_mode"),
-                FieldPanel("navbar_format"),
-                FieldPanel("navbar_search"),
+                "navbar_color_scheme",
+                "navbar_class",
+                "navbar_fixed",
+                "navbar_content_fluid",
+                "navbar_collapse_mode",
+                "navbar_format",
+                "navbar_search",
             ],
             heading=_("Site Navbar Layout"),
         ),
@@ -176,23 +176,23 @@ class LayoutSettings(ClusterableModel, BaseSiteSetting):
     panels = [
         MultiFieldPanel(
             [
-                FieldPanel("logo"),
-                FieldPanel("favicon"),
+                "logo",
+                "favicon",
             ],
             heading=_("Branding"),
         ),
         MultiFieldPanel(
             [
-                FieldPanel("from_email_address"),
-                FieldPanel("search_num_results"),
-                FieldPanel("external_new_tab"),
+                "from_email_address",
+                "search_num_results",
+                "external_new_tab",
             ],
             heading=_("General"),
         ),
         MultiFieldPanel(
             [
-                FieldPanel("google_maps_api_key"),
-                FieldPanel("mailchimp_api_key"),
+                "google_maps_api_key",
+                "mailchimp_api_key",
             ],
             heading=_("API Keys"),
         ),
@@ -243,7 +243,7 @@ class NavbarOrderable(Orderable, models.Model):
         on_delete=models.CASCADE,
     )
 
-    panels = [FieldPanel("navbar")]
+    panels = ["navbar"]
 
 
 class FooterOrderable(Orderable, models.Model):
@@ -259,7 +259,7 @@ class FooterOrderable(Orderable, models.Model):
         on_delete=models.CASCADE,
     )
 
-    panels = [FieldPanel("footer")]
+    panels = ["footer"]
 
 
 @maybe_register_setting(crx_settings.CRX_DISABLE_ANALYTICS, icon="cr-google")
@@ -318,21 +318,21 @@ class AnalyticsSettings(BaseSiteSetting):
         ),
         MultiFieldPanel(
             [
-                FieldPanel("ga_g_tracking_id"),
-                FieldPanel("ga_track_button_clicks"),
+                "ga_g_tracking_id",
+                "ga_track_button_clicks",
             ],
             heading=_("Google Analytics"),
         ),
         MultiFieldPanel(
             [
-                FieldPanel("gtm_id"),
+                "gtm_id",
             ],
             heading=_("Google Tag Manager"),
         ),
         MultiFieldPanel(
             [
-                FieldPanel("head_scripts"),
-                FieldPanel("body_scripts"),
+                "head_scripts",
+                "body_scripts",
             ],
             heading=_("Other Tracking Scripts"),
         ),

+ 4 - 4
coderedcms/project_template/pro/website/models.py

@@ -223,8 +223,8 @@ class Navbar(models.Model):
     )
 
     panels = [
-        FieldPanel("name"),
-        FieldPanel("content"),
+        "name",
+        "content",
     ]
 
     def __str__(self) -> str:
@@ -251,8 +251,8 @@ class Footer(models.Model):
     )
 
     panels = [
-        FieldPanel("name"),
-        FieldPanel("content"),
+        "name",
+        "content",
     ]
 
     def __str__(self) -> str:

+ 9 - 0
coderedcms/templates/coderedcms/previews/blocks/pagepreview_block_preview.html

@@ -0,0 +1,9 @@
+{% extends "wagtailcore/shared/block_preview.html" %}
+
+
+{% block content %}
+<div class="container py-3">
+  {{block_def.value}}
+  {% include 'coderedcms/pages/page.mini.html' %}
+</div>
+{% endblock %}

+ 7 - 1
coderedcms/templates/wagtailcore/shared/block_preview.html

@@ -12,4 +12,10 @@
 <link rel="stylesheet"
   href="{% static 'coderedcms/vendor/bootstrap/dist/css/bootstrap.min.css' %}?v={% coderedcms_version %}">
 
-{% endblock %}
+{% endblock %}
+
+{% block content %}
+<div class="container py-3">
+  {{ block.super }}
+</div>
+{% endblock %}

+ 3 - 3
docs/advanced/advanced02.rst

@@ -191,9 +191,9 @@ We need to add other fields to be be in alignment with the outline we looked at
 
         # Add custom fields to the body
         body_content_panels = CoderedWebPage.body_content_panels + [
-            FieldPanel("description"),
-            FieldPanel("photo"),
-            FieldPanel("need_prescription"),
+            "description",
+            "photo",
+            "need_prescription",
         ]
 
 

+ 3 - 3
docs/features/snippets/classifiers.rst

@@ -78,8 +78,8 @@ model (Snippet example below)::
             blank=True,
         )
         panels = [
-            FieldPanel('name')
-            FieldPanel('classifier_terms'),
+            'name'
+            'classifier_terms',
         ]
 
 
@@ -91,7 +91,7 @@ use the built-in ``ClassifierSelectWidget``::
         from coderedcms.widgets import ClassifierSelectWidget
 
         panels = [
-            FieldPanel('name')
+            'name',
             FieldPanel('classifier_terms', widget=ClassifierSelectWidget()),
         ]
 

+ 1 - 1
docs/how_to/translation.rst

@@ -53,7 +53,7 @@ model in ``website/models.py``:
     class WebPage(CoderedWebPage):
         body_content_panels = []
         content_panels = CodredWebPage.content_panels + [
-            FieldPanel('body'),
+            'body',
         ]