[Fixed]-How to add a blank page and generate a menu using wagtail(nescode)?

1👍

I find the answer.

Step1:

Basically I add in a new model to demo > models.py as follows

class NewsPage(Page):
    body = RichTextField()
    date = models.DateField(“Post date”)
    search_name = “News Page”
    indexed_fields = (‘body’, )

    NewsPage.content_panels = [
    FieldPanel(‘title’, classname=”full title”),
    FieldPanel(‘date’),
    FieldPanel(‘body’, classname=”full”),
    ]

Step2:

./manage.py migrate

Step3:

add file news_page.html
enter image description here

Step4:

Finaly you can see the button that can create the news_page.
enter image description here

Leave a comment