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: show correct posts after setting "Inherit query from template" #42675

Closed
annezazu opened this issue Jul 25, 2022 · 8 comments · Fixed by #52521
Closed

Query Loop: show correct posts after setting "Inherit query from template" #42675

annezazu opened this issue Jul 25, 2022 · 8 comments · Fixed by #52521
Assignees
Labels
[Block] Query Loop Affects the Query Loop Block [Status] In Progress Tracking issues with work in progress [Status] Needs More Info Follow-up required in order to be actionable. [Type] Bug An existing feature does not function as intended

Comments

@annezazu
Copy link
Contributor

Description

After creating one of the new templates (categories, tags, date, author, etc), adding a Query Loop block, and setting it to "Inherit query from template", it's not clear that the query loop will correctly show posts based on the template. Instead, nothing changes in the editor (same posts are shown), despite the query loop working correctly on the front end. I understand this might be intentional for a template like Author or Date since that'll depend on which author is being viewed but for templates around categories or tags this proves to be confusing.

This was found as part of the fifteenth call for testing for the FSE Outreach Program.

Step-by-step reproduction instructions

  1. Go to Appearance > Editor > Templates > Add New
  2. Create a new category template for a specific category of posts.
  3. Add a query loop block.
  4. Toggle on "Inherit query from template" in the block sidebar settings.
  5. Notice no change to what posts are displayed in the editor but notice that if you view the category page the template shows correctly.

Screenshots, screen recording, code snippet

No response

Environment info

  • WP 6.0.1
  • GB 13.7.2

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@annezazu annezazu added [Type] Bug An existing feature does not function as intended Needs Design Feedback Needs general design feedback. [Block] Query Loop Affects the Query Loop Block labels Jul 25, 2022
@mjsdiaz
Copy link

mjsdiaz commented Jul 25, 2022

I see this issue too.

@ntsekouras
Copy link
Contributor

That's a quite hard problem.. For example if we have a Query Loop block in index.html what would be the correct posts? index is the fallback to everything and could be different in so many scenarios. Same goes for category.html etc... Maybe we could do something for more specific templates.. Also we could add a message about this when we inherit maybe? 🤔

@annezazu
Copy link
Contributor Author

Yeah, this seems really tricky to think through. I'd be keen to hear from @WordPress/gutenberg-design in this sense as it does feel like a design problem almost. How do you indicate something has changed but that it might not perfectly reflect what you're seeing in the editor, especially when it aims to be WYSIWYG?

@jameskoster
Copy link
Contributor

Related: #42554, #41947

Maybe we could do something for more specific templates

I think this would be a good start.

@jameskoster
Copy link
Contributor

Similarly it would be nice if the Archive Title block displayed a more contextual placeholder. E.g. in the category template it might display 'Category name'. In category-recipes it would display 'Category: Recipes', etc. This would be a lot more intuitive than the current generic 'Archive Title'.

@annezazu
Copy link
Contributor Author

This is still a problem with WordPress 6.2.

@annezazu annezazu added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Apr 28, 2023
@jorgefilipecosta jorgefilipecosta self-assigned this Jul 10, 2023
@priethor priethor added [Status] In Progress Tracking issues with work in progress and removed Needs Dev Ready for, and needs developer efforts labels Aug 7, 2023
@jorgefilipecosta
Copy link
Member

Hi @annezazu, I think this issue has been fixed and we missed closing it. Can you confirm if things now work well for you? Thank you in advance 😊

@jorgefilipecosta jorgefilipecosta added the [Status] Needs More Info Follow-up required in order to be actionable. label Jun 12, 2024
@annezazu
Copy link
Contributor Author

It works! Here's a video:

works.mov
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 [Status] In Progress Tracking issues with work in progress [Status] Needs More Info Follow-up required in order to be actionable. [Type] Bug An existing feature does not function as intended
6 participants