if I have a Page class like this:
class LocationPage(AppPageMixin, Page):
template = 'locations/locations_list.html'
url_config = 'location.urls'
...
It allows me to create pages dynamically off of the LocationPage by entering objects into my Admin Model. It took me forever to get this to work but I got it.
The issue that I am having now is that I can't seem to add custom fields to the LocationPage anymore. I just need a banner image, title, and subtitle. The rest of the content comes from a loop through my Admin Model. I did what one would normally do to add fields to a page model:
class LocationPage(AppPageMixin, Page):
template = 'locations/locations_list.html'
url_config = 'location.urls'
banner_image = models.ForeignKey(
"wagtailimages.Image",
null=True,
blank=False,
on_delete=models.SET_NULL,
related_name="+"
)
page_title = models.CharField(max_length=200, null=True, blank=False)
page_subtitle = models.CharField(max_length=300, null=True, blank=False)
panels = [
FieldPanel('page_title'),
FieldPanel('page_subtitle'),
ImageChooserPanel('banner_image'),
]
I migrated, but when I go to my current page using LocationPage, or if I create a new page, the fields do not show. this documentation (https://wagtail-app-pages.readthedocs.io/en/latest/) does not mention anything about how to do this or if it is possible, but I'd say it's a pretty common requirement. Having to enter static content into the template defeats the purpose of using a cms. am I missing something?
AppPageMixinon the question. Just a thought, maybe you have usedModeltheAppPageMixinwithout it being an abstract class docs.djangoproject.com/en/3.0/topics/db/models/… - LB Ben Johnston