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

Search Block: Add flexible query attributes #41204

Closed
LukaszJaro opened this issue May 20, 2022 · 6 comments
Closed

Search Block: Add flexible query attributes #41204

LukaszJaro opened this issue May 20, 2022 · 6 comments
Labels
[Block] Search Affects the Search Block - used to display a search field [Type] Enhancement A suggestion for improvement.

Comments

@LukaszJaro
Copy link

What problem does this address?

I can't do simple things like:

  • Exclude/include categories, posts, etc
  • Set post type (page, post, custom post type, etc)
  • Order of search results

Not so simple things:

  • Search by post title only
  • Search published date(i.e, May 20th)
  • Control whether to search in title, content, meta or all

What is your proposed solution?

Add these settings in the block settings panel.

@Mamaduka
Copy link
Member

Hi, @LukaszJaro

You can create search block variations and preset query attributes. See #40585 for more details.

@tomasztunik, is there a general tracking issue for search query attribute UI and improvements?

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] Search Affects the Search Block - used to display a search field labels May 20, 2022
@tomasztunik
Copy link
Contributor

@Mamaduka I was planning to set it up when I'm back from my trip next week - if it was more pressing someone would have to take it over.

And whoa! what were the odds that someone would post a related issue right after getting the first step for this in! :)

@LukaszJaro - the ability to control query params via block variations will go live with Gutenberg 13.4. Also, it will be later easy to convert these custom variations to regular search blocks once UI for these features goes live. Variations are 100% compatible with their parent block and once you unregister the variation, the variation block simply becomes the parent block with the given variation attributes set.

@LukaszJaro
Copy link
Author

Wow that's great, thank you @Mamaduka and @tomasztunik

Looks like June 1st is release date for 13.4 so I'll be sure to test this out then, thank you for the great work!

@ndiego
Copy link
Member

ndiego commented Nov 6, 2022

Just stumbled upon this issue. Can this now be closed since #40585 is merged?

@Mamaduka
Copy link
Member

Mamaduka commented Nov 7, 2022

There's also a new article on extending the query block - https://make.wordpress.org/core/2022/10/10/extending-the-query-loop-block/.

@LukaszJaro
Copy link
Author

Thank you for this addition, has been very useful! The accompanying article is also very informative. Looking forward to the interface to add these options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Search Affects the Search Block - used to display a search field [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants