Skip to content

feat: add displaySubtitle to card#100

Merged
laravdiemen merged 1 commit into
mainfrom
feat/display-subtitle
Apr 21, 2026
Merged

feat: add displaySubtitle to card#100
laravdiemen merged 1 commit into
mainfrom
feat/display-subtitle

Conversation

@laravdiemen
Copy link
Copy Markdown
Contributor

Het query block heeft een extra optie gekregen (yardinternet/wp-query-block#142) dus in deze PR wordt dat toegepast.

@github-actions
Copy link
Copy Markdown

Composer package changes
Prod Packages Operation Base Target Link License
yard/query-block Upgraded v1.4.1 v1.5.0 Compare MIT

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Sage theme’s query-block card rendering to support the new displaySubtitle option introduced in yard/query-block (per linked upstream PR), and wires that option through to the card component.

Changes:

  • Pass displaySubtitle from the query-block’s BlockAttributes into <x-dynamic-card> for both default and horizontal templates.
  • Add displaySubtitle support to the theme’s Card component and conditionally render the subtitle based on it.
  • Bump yard/query-block in composer.lock to v1.5.0.

Reviewed changes

Copilot reviewed 2 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
web/app/themes/sage/resources/views/vendor/yard-query-block/templates/horizontal.blade.php Passes displaySubtitle through to the dynamic card in the horizontal query-block layout.
web/app/themes/sage/resources/views/vendor/yard-query-block/templates/default.blade.php Passes displaySubtitle through to the dynamic card in the default query-block layout.
web/app/themes/sage/resources/views/components/card.blade.php Only renders the subtitle when displaySubtitle is enabled.
web/app/themes/sage/app/View/Components/Card.php Adds displaySubtitle prop and defaulting logic to the Card component.
composer.lock Updates yard/query-block to v1.5.0 (but also includes additional lockfile metadata changes).

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

LGTM

Extended reasoning...

Overview

This PR adds a displaySubtitle boolean prop to the Card component, following the exact same pattern already used by displayDate, displayExcerpt, displayImage, and displayLabel. The change consists of: adding the constructor parameter in Card.php, setting its default to true in setDisplayDefaults(), updating the blade template to gate the subtitle output on the flag, and threading the new attribute through both query-block templates. The composer.lock bump upgrades yard/query-block from v1.4.1 to v1.5.0, which is the upstream package that introduced the displaySubtitle() method being called here.

Security risks

No security risks. The subtitle value is rendered with {\!\! $subtitle \!\!} (unescaped), but this was already the case before this PR — the new code only adds an additional boolean guard, it does not change the escaping behaviour.

Level of scrutiny

Low. This is a purely mechanical, pattern-following addition of one optional feature flag. Every line of the change mirrors an existing prop (displayLabel) with no novel logic.

Other factors

No bugs were reported by the bug hunting system. The change is small, self-contained, and consistent with the established conventions in the codebase.

@laravdiemen laravdiemen merged commit a8e6ef3 into main Apr 21, 2026
8 checks passed
@laravdiemen laravdiemen deleted the feat/display-subtitle branch April 21, 2026 13:28
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