-
Notifications
You must be signed in to change notification settings - Fork 40
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 external page link to "Read next" sidebar on ResourcePage #3995
Add external page link to "Read next" sidebar on ResourcePage #3995
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is exactly what we needed @johnnyporkchops. Much appreciated! Thanks!
If you want to see the test page I created, it's at https://fec-feature-cms.app.cloud.gov/help-candidates-and-committees/keeping-records/best-efforts-test-page/. Worked great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thank you @johnnyporkchops
@johnnyporkchops I'm going to go ahead and merge this since we have content team approvals and we have a 13.4 ticket for the content team to test the wagtail upgrade next week. Can you keep an eye on this please? ⬇️
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rebased this off the latest develop
changes locally to make sure the wagtail upgrade didn't break anything, and the tests pass. Thanks for your work on this @johnnyporkchops!
Summary (required)
Add a
RichTextBlock
to therelated_pages
("Read next") section onResourcePage
templates, allowing editors to add an external link in addition to the existing internal PageChooserBlock.Adjust temp[late logic to accommodate
We chose a
RichTextBlock
to give editors the versatility to add an external link as well as pretty much any other content they might need to add here.The seemingly extraneous looping in the template is necessary because the
PageChooserBlock
is inside aListBlock
, requiring looping to separate them into<li>s
on the front end.. Attempts to simplify template logic by switching from aListBlock
to a singular block in the model would group existing database entries forPageChooser
ListBlocks
into one<li>
on the front end.Resolves Wagtail wish list: In resource page template, allow the "related page" to be an external link #3794
Impacted areas of the application
modified: home/models.py
modified: home/templates/home/resource_page.html
Screenshots
Wagtail admin:
Rendered page:
How to test
Content team: This is published on feature space at: https://fec-feature-cms.app.cloud.gov/
Developers:
feature/3794-external-related-page-ResourcePage
Related pages
, andExternal Pages
to the "Related Page" and preview/publish to confirm that both show.ResourcePage
and confirm Related Pages section allows to add both internal and external links in an interspersed order.Note on migrations: This is an example of a models.py streamfield change that does not require a migration to run properly, but would make a new migration file upon running
makemigrations
., referncing the added block name for the streamfield (but nothing actually changes in the databae) . Rather than push up a migration file for this, It can wait and will get picked up/added next time someone does a crucialmakemigrations/migrate
for a more substantial models.py change (i.e: upcomingCommissoinerItem
model addition. Reference: wagtail/wagtail#3710