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 Loop block: Clarify explanation around query loop variation example #62605

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

artemiomorales
Copy link
Contributor

What?

This PR clarifies that specifying the layout of a query loop block variation is needed in order for the variation to function properly.

Why?

Currently, the documentation is not clear that the Customize your variation layout step is needed — and if this is not done, the variation defaults to allowing the user to pick a layout in the UI, which overwrites the variation's attributes.

How?

It adds numbers to the headings under Extending the block with variations and also adds a clarifying sentence to ensure users follow the next step.

Testing Instructions

N/A

Testing Instructions for Keyboard

N/A

@artemiomorales artemiomorales added [Type] Developer Documentation Documentation for developers [Block] Query Loop Affects the Query Loop Block labels Jun 16, 2024
@artemiomorales artemiomorales marked this pull request as ready for review June 16, 2024 18:14
Copy link

github-actions bot commented Jun 16, 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: artemiomorales <artemiosans@git.wordpress.org>
Co-authored-by: juanmaguitar <juanmaguitar@git.wordpress.org>

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

@artemiomorales
Copy link
Contributor Author

I'm not sure that this PR will completely clarify the explanation, though I believe it will help. Any thoughts appreciated! 🙏

Copy link

Flaky tests detected in 9933b92.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9537974145
📝 Reported issues:

@juanmaguitar
Copy link
Contributor

Thanks for the PR @artemiomorales!
The changes look good and clarify the prerequisites for a customized query loop to work properly a bit more.

To provide even more clarity over these "requisites" I would also add just before...

Let's go on a journey, for example, of setting up a variation for a plugin ...

Something along the following lines:

In order to have a Query Loop variation properly working we'll need to 
- register the block variation for the `core/query` block with some default values
- define a layout for the block variation
- use the `namespace` attribute in the `isActive` block variation property

To provide an overview of what's explained next in more detail to ensure the block variation works as expected.

@akasunil akasunil merged commit 3680152 into trunk Jun 21, 2024
60 checks passed
@akasunil akasunil deleted the add/clarify-extend-query-loop-docs branch June 21, 2024 12:44
@github-actions github-actions bot added this to the Gutenberg 18.7 milestone Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants