Skip to content
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

Query Title: Add block example #65554

Merged
merged 1 commit into from
Sep 23, 2024
Merged

Conversation

aaronrobertshaw
Copy link
Contributor

Part of: #64707
Related: #65430

What?

Adds a block example definition for the Query Title block.

Why?

The Style Book is being iterated on and part of that effort is to ensure the desired blocks are shown there. Currently, this is dependent on blocks having an example defined.

How?

Adds an example to the Query Title block.

Testing Instructions

  1. In the editor, open the main block inserter from the top left
  2. Search for the Archive Title variation of the Query Title block and hover over it
  3. Confirm the preview for the block displays correctly
  4. Repeat that for the Search Results Title variation
  5. Navigate to the Style Book, (Appearance > Editor > Styles > Style Book icon) and switch to the "Theme" tab.
  6. Confirm the Query Title block is displayed here

Screenshots or screencast

Style Book Archive Title (Inserter) Search Results Title (Inserter)
Screenshot 2024-09-23 at 2 34 05 pm Screenshot 2024-09-23 at 2 34 24 pm Screenshot 2024-09-23 at 2 35 56 pm

@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Block] Query Title Affects the Query Title Block labels Sep 23, 2024
@aaronrobertshaw aaronrobertshaw self-assigned this Sep 23, 2024
Copy link

github-actions bot commented Sep 23, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Comment on lines +32 to +36
"example": {
"attributes": {
"type": "search"
}
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the block variations (for Archive and Search Results titles) override the type attribute so they don't need their own custom example definitions within variations.js

@aaronrobertshaw
Copy link
Contributor Author

Similar to the Post Navigation Link block, we could display the block variations in the Style Book. For now though, I just went with the Search Results Title type for the Style Book example. That can be tweaked later if desired.

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

🚀

Screenshot 2024-09-23 at 3 01 15 pm
Kapture.2024-09-23.at.15.00.33.mp4

@aaronrobertshaw aaronrobertshaw merged commit dad62c6 into trunk Sep 23, 2024
69 of 70 checks passed
@aaronrobertshaw aaronrobertshaw deleted the add/query-title-block-example branch September 23, 2024 05:21
@github-actions github-actions bot added this to the Gutenberg 19.4 milestone Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Title Affects the Query Title Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants