Skip to content

feat: add tag labels to the Carousel block#429

Open
jason10lee wants to merge 5 commits into
mainfrom
feat/tag-labels-carousel
Open

feat: add tag labels to the Carousel block#429
jason10lee wants to merge 5 commits into
mainfrom
feat/tag-labels-carousel

Conversation

@jason10lee

@jason10lee jason10lee commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

A polish pass that fills a component gap (tag labels in the Carousel block) and makes the label treatment consistent across every context that renders post labels.

Carousel block (newspack-blocks)

  • New Show tag labels toggle (showTagLabels, default true) in the Carousel's Post Meta settings, mirroring the Content Loop (Homepage Posts) block.
  • Editor preview and front-end (view.php) render tag labels above the headline, after the category/sponsor labels. The taxonomy fetch is gated on the attribute, and the labels-only case (categories off, no sponsors) renders correctly.
  • Carousel tag-label color honors the theme Customizer (.wpnbpc added to the inline color selector).

Label order + layout (newspack-theme) — also corrects the already-merged Content Loop block + single-post / archive / search rendering

  • Tag labels now render after the category (and sponsor) label, consistently across single posts, archives, search, blog index, Content Loop, and Carousel (entry-header.php, content-archive.php, content-excerpt.php), matching the "after any category or sponsorship labels" intent.
  • Category and tag labels now sit inline on one line in all of those contexts. In the Content Loop / Carousel blocks they previously stacked because the block CSS .wpnbha/.wpnbpc .cat-links{display:flex} beat the generic inline rule on specificity; this adds block-scoped rules at higher specificity (excluding sponsor rows so their own flex/gap layout wins deterministically). The editor-preview SCSS was updated to match.

⚠️ This is a theme change, so the layout/order fix also applies to the already-merged Content Loop block and single posts / archives / search — not just the Carousel.

Rollout note: showTagLabels defaults to true (consistent with Content Loop). Any existing Carousel block on a site that already uses flagged tag labels will begin rendering them on next load. Worth a release-notes mention.

Related: NPPD-383: "Breaking News" or "Developing" Label. Builds on parent PRs Automattic/newspack-plugin#4381, Automattic/newspack-blocks#2282, Automattic/newspack-theme#2613.

How to test the changes in this Pull Request:

  1. With the Newspack plugin and a Newspack theme active: go to Posts → Tags, edit a tag, check Display as label, optionally set Label text, and save.
  2. Assign the tag to a couple of published posts (give them a category too).
  3. Add a Carousel block showing those posts. In the block's Post Meta settings, confirm the Show tag labels toggle (on by default). On the front end, confirm the label appears above the headline, after the category, on one line.
  4. Confirm the same category-then-tag, single-line treatment in: a Homepage Posts block, a single post, a category/tag archive, and a search results page.
  5. Confirm the labels-only case (category off, no sponsor) still shows the tag label.
  6. Appearance → Customize → Tag Labels: pick a color and confirm it applies to Carousel labels too.
  7. Toggle Show tag labels off and confirm the labels disappear.

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? — N/A (presentational: block render + theme template/CSS).
  • Have you successfully run tests with your changes locally? — lint (JS/SCSS/PHPCS) clean; CI green; verified live in an isolated env across single post, Content Loop, Carousel, archive, and search.

jason10lee and others added 2 commits June 25, 2026 10:58
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 25, 2026 20:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jason10lee jason10lee self-assigned this Jun 25, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jason10lee jason10lee marked this pull request as ready for review June 25, 2026 20:50
@jason10lee jason10lee requested a review from a team as a code owner June 25, 2026 20:50
jason10lee and others added 2 commits June 30, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants