Skip to content

Conversation

@rbcorrales
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

This PR refactors the Collections intro template to use the Collections block for rendering instead of hardcoded HTML, to make the block and template output consistent.

There are a few improvements to the overall list layout of the Collections block to make it match the styling from the template part.

Closes NPPD-883.

How to test the changes in this Pull Request:

  1. Verify intro section rendering
  • Visit any single collection page
  • Confirm intro section displays correctly (image, title, meta, excerpt, CTAs)
  1. Perform the same tests from above on the archive page.
  2. Test with numberOfCTAs= -1 and verify all CTAs display
  3. Check styling consistency
  • Compare the single collection page intro with the Collections block output
  • Test responsive behavior on mobile/desktop

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@rbcorrales rbcorrales requested a review from a team as a code owner September 11, 2025 06:05
@rbcorrales rbcorrales added [Status] Needs Review The issue or pull request needs to be reviewed [Status] Needs Design Review labels Sep 11, 2025
Copy link
Contributor

@dkoo dkoo left a comment

Choose a reason for hiding this comment

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

@rbcorrales: Approving based on the PR description and the changeset! Am I correct that the attributes for displaying the grid in the archives and the intro in the single collection template are hardcoded, but filterable through code? To test the archive with "numberOfCTAs" => -1 I filtered the attributes using newspack_collections_render_grid_attrs.

@rbcorrales
Copy link
Member Author

@dkoo Correct, the block attributes are filterable. For the number of CTAs, we can later surface this option in the block editor, but for this PR, it was more to make the block serve as a drop-in replacement for the previous HTML template, which rendered all CTAs by default. I could have also hardcoded it to a large number so it will fit most use cases, but I think it's cleaner and more intentional this way 😄

Thanks!

@dkoo dkoo added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Sep 11, 2025
@rbcorrales rbcorrales merged commit 154d230 into feat/collections-archive-block-grid Sep 12, 2025
8 of 9 checks passed
@rbcorrales rbcorrales deleted the feat/collections-block-intro branch September 12, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants