Repository navigation
Add template events for the news cards and the new layout - #4
Merged
Merged
Conversation
phpBB's own post events that fit the news card are now fired in the same places as in viewtopic: before the subject, around the post buttons list, the rank, the text and the signature, and around the back-to-top arrow. New events cover the parts the refreshed layout added: the end of the byline and of the "Showing" line, around the lead image, the start and end of the footer line, and before and after a single news item. docs/events.md lists every event with where it fires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds template events to the news page, so other extensions and styles can add to it without editing NV Newspage. It's template-only: nothing changes on the page until something uses an event.
phpBB's post events in the news cards
Each news card already fired some of phpBB's own
viewtopic_body_*events. This adds the rest that fit, in the same places as in phpBB'sviewtopic_body.html. An extension that adds something to forum posts (a thanks button, a badge, share links) now usually shows it on the news page too.viewtopic_body_post_subject_beforeviewtopic_body_post_buttons_list_before/_afterviewtopic_body_postrow_rank_before/_afterviewtopic_body_postrow_content_before/_afterviewtopic_body_postrow_signature_before/_afterviewtopic_body_postrow_back2top_before/_prepend/_append/_afterFor the back-to-top hooks, the arrow now sits in a
back2topblock as in phpBB, still at the end of the footer line.phpBB's contact-menu and Who is online events aren't added, because the news page has neither.
New events for the refreshed layout
phpbbmodders_newspage_byline_append: at the end of the byline.phpbbmodders_newspage_active_filters_append: at the end of the "Showing" line, for an extra filter chip.phpbbmodders_newspage_lead_image_before/_after: around the lead image, only when one is shown.phpbbmodders_newspage_footer_prepend/_append: at the start and end of the footer line;_appendsits before the back-to-top arrow, for share or like links.phpbbmodders_newspage_single_before/_after: on a single news item, above the "All news" link and after the item, for things like related news.They use the
phpbbmodders_newspageprefix. The original events keep theirnickvergessennames, so styles and listeners written for them keep working.docs/events.mdis rewritten as two tables (news page, each news item) listing every event in page order, with where it fires and when it doesn't. The old copy still listed the contact-menu events, which the layout refresh in #3 removed.Testing
Claude made a throwaway extension that fills all 41 template events with a marker, and counted the markers on seed-forum boards with phpBB 3.3.19 and 4.0.0-a3-dev. The pages were the news list (5 items), a list filtered by forum (3 items) and a single news item. Every event fired where and as often as
docs/events.mdsays, on both boards:The test extension was removed afterwards. The back-to-top arrow still sits at the right end of a one-line footer. Unit tests (165, on 3.3.x and master) and
template_a11y.pypass.Investigated and written by Claude on behalf of William Jacoby (bonelifer).
🤖 Generated with Claude Code