Skip to content

Story 2096: Implement Wagtail Integration#2100

Open
jlchilders11 wants to merge 5 commits into
boostorg:developfrom
jlchilders11:jc/wagtail-integration
Open

Story 2096: Implement Wagtail Integration#2100
jlchilders11 wants to merge 5 commits into
boostorg:developfrom
jlchilders11:jc/wagtail-integration

Conversation

@jlchilders11
Copy link
Copy Markdown
Collaborator

Implement Wagtail Integrations:

Mixins

  • FlaggedMixin - Adds a custom serve method to prevent unflagged users from seeing this page
  • TaggableMixin - Adds the ability to tag pages for categorization

Routing

  • RoutableHomePage - New home page for all wagtail interactions that allows for forwarding routing to child pages, e.g. if you get to wagtail through /outreach/, you will be routed through the OutreachHomePage

Posts

This is the bulk of the work, and is a porting of the existing Entry Model to Wagtail

  • PostIndexPage - Index Page for Posts, implements most of the logic in formatting found in the news.views.EntryListView. NOTE: this uses queryparams for filtering the child pages, rather than seperate URLs
  • PostPage - Functional translation of Entry, but uses a stream field rather than having separate models for different types of content. These can be filtered by the content of the stream field block

NOTES:

  • Additional work/discussion is needed on the PollBlock. Currently this is not implemented, as it is disabled in the existing architecture, and will be non trivial to implement in Wagtail
  • Additional work is needed for the video block to both automatically save the thumbnail, and display it instead of autoloading the video.

DEPLOYMENT NOTES:
When deploying this, a RoutableHomePage should be created and the existing OutreachHomePage should be moved under it to respect the new routing methods.

@jlchilders11 jlchilders11 changed the title Story 2096: Implment Wagtail Integration Story 2096: Impliment Wagtail Integration Feb 26, 2026
Copy link
Copy Markdown
Collaborator

@gregjkal gregjkal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per our conversation in standup: please test the homepage to make sure it won't break without manually migrating the existing testimonial and/or news items. If it does break, we need to either make these changes backwards-compatible (my strong preference!), with a follow-up change that cleans any bridge code up, or add a data migration so it can be fixed during the deploy instead of crashing until manual fixes.

Comment thread pages/migrations/0001_initial.py
@julioest julioest changed the title Story 2096: Impliment Wagtail Integration Story 2096: Implement Wagtail Integration May 10, 2026
Copy link
Copy Markdown
Collaborator

@julhoang julhoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jlchilders11 ! This is awesome work! I just left a few of clarifying questions below.

Besides them, it looks like the HTML templates are now outdated. Do you have a next-step recommendation for us to update those templates to V3 versions? Also, do we need to update the V3 Create Post page and various other existing queries to query from Wagtail's PostPage instead of Entry?

Thanks so much for your work here!

]
page.save()
videos = Video.objects.all()
print(f"Creating or updating {news_posts.count()} Videos")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should this be videos.count() instead?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it the template for http://localhost:8000/pages/ ? It seems like this page just stay blank – would you mind helping me understand why we need this?

Comment thread config/urls.py
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
+ [
path("outreach/", include(wagtail_urls)),
path("pages/", include(wagtail_urls)),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind helping me understand why we need to route the /news path via /pages with Wagtail, instead of being able to navigate to it directly? It seems like we can navigate to http://localhost:8000/outreach/ directly, is it not possible to do the same with /news? Or is the idea here to have Wagtail lives on a separate prefix for development phase til we are ready to replace the legacy path? 🤔

Comment thread pages/models.py

# Defines this as a home page
parent_page_types = ["wagtailcore.Page"]
#
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪓?

Comment thread pages/mixins.py
Comment on lines +47 to +54
class FlaggedMixin(Page):
def serve(self, request, *args, **kwargs):
if not waffle.flag_is_active(request, "v3"):
return HttpResponseForbidden("You do not have access to this page.")
return super().serve(request, *args, **kwargs)

class Meta:
abstract = True
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it work if we use V3Mixin directly? 🤔

If not, can we return 404 when user doesn't have permission, so that they won't have a hint that this page exists?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants