Skip to content

Page object not initializing on Home Page template #84

@LordXyTh

Description

@LordXyTh

Hello,

I've built the project, added a new field to the HomePage model, and added data via the admin panel.
However, when I'm trying to render {{page.body}} to the template, I get nothing. When I create a child page of the home page, it seems to work. But I need to be able to use all this for my home page. Not sure whats going on :(

models.py
`from wagtail.models import Page
from wagtail.fields import RichTextField
from wagtail.admin.panels import FieldPanel

class HomePage(Page):
body = RichTextField(blank=True)

content_panels = Page.content_panels + [
    FieldPanel('body'),
]`

templates/home/home_page.html

`{% extends "base.html" %}

{% load wagtailcore_tags %}

{% block body_class %}template-homepage{% endblock %}

{% block content %}

{{page.title}}
{{ page.body|richtext }}

{% endblock %}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions