Reputation: 1486
So this awesome Wagtail/Django framework is nice! I like it allot.
Still getting used to but seems straight forward, What I do not understand tho is how can I access default page models and render them in the templates?
So Wagtail has this models that you make based on their Page class.
class SomeClass(Page):
"""
Some text
"""
intro = models.CharField(max_length=255, blank=True)
body_small = models.CharField(max_length=255, blank=True)
All good and well. Now my page template looks like this
{% extends "base.html" %}
{% load wagtailcore_tags %}
{% block base_content %}
{{ page.intro }}
{{ page.body_small }}
{% endblock %}
Now I want to add the settings model items like Published Date. Those are default from Wagtail, see:
What page model do I need to use?
{{ page.published_date }} //Does not work
Any suggestions?
Upvotes: 1
Views: 658
Reputation: 25227
The fields in the Settings tab are available as {{ page.go_live_at }}
and {{ page.expire_at }}
. However, these are only used for scheduled publishing so may not be a particularly relevant thing to output on the page - {{ page.first_published_at }}
and {{ page.last_published_at }}
are probably more useful. See http://docs.wagtail.io/en/stable/reference/pages/model_reference.html for more.
Upvotes: 1