Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for previewing blog posts in list view #6245

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chosak
Copy link
Member

@chosak chosak commented Jan 29, 2021

This change prototypes using Wagtail's page preview modes to allow for previewing of blog posts in their list view, i.e. how they show up on the blog page.

How to test this PR

Run a local server and edit a blog page. Note that the Preview button is now a dropdown, and you can either preview as normal or preview the post in its "post preview" mode.

Screenshots

image

image

Notes and todos

This can't be merged right now because the use of Django template caching here means that previewing changes either won't work as expected or will incorrectly cache draft data. A solution to this might involve checking request.is_preview and somehow skipping the {% cache %} tag or (preferably) removing the need for that caching altogether.

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code follows the standards laid out in the CFPB development guidelines
  • Future todos are captured in comments and/or tickets

@Scotchester
Copy link
Contributor

@willbarton This might be a side task we can pick up after addressing the post preview cache in our performance epic.

To test, create or edit a BlogPage and look at the sidebar preview.
@chosak
Copy link
Member Author

chosak commented Jan 2, 2024

This can't be merged right now because the use of Django template caching here means that previewing changes either won't work as expected or will incorrectly cache draft data. A solution to this might involve checking request.is_preview and somehow skipping the {% cache %} tag or (preferably) removing the need for that caching altogether.

Wagtail 5.2 introduces a new {% wagtailcache %} template tag that we may be able to adopt to get past this blocker, once we upgrade to that version.

@anselmbradford
Copy link
Member

Wagtail 5.2 introduces a new {% wagtailcache %} template tag that we may be able to adopt to get past this blocker, once we upgrade to that version.

Now that we're on Wagtail 6, is this unblocked?

@chosak
Copy link
Member Author

chosak commented May 10, 2024

@anselmbradford I was actually looking at this again recently. I have some local changes I can try to push up to this PR. It turns out this wasn't blocked by Wagtail 6 after all, since we're using Jinja for this cache tag, not the Django template language, so we can't use Wagtail's {% wagtailcache %} anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants