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

Context detection for Query block #30369

Open
ntsekouras opened this issue Mar 30, 2021 · 0 comments
Open

Context detection for Query block #30369

ntsekouras opened this issue Mar 30, 2021 · 0 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement.

Comments

@ntsekouras
Copy link
Contributor

ntsekouras commented Mar 30, 2021

We need to find a way to detect the context a Query block 'lives' and handle any settings needed appropriately. By context I mean FSE context (site-editor) or a page/post (post-editor). Moreover is valuable to even know the kind of template we are on FSE context (related: #29438).

Noting that we'll also have to take into account what happens when we are in post-editor and we edit the template from there.

There is an inherit property in Query which defaults to true and with that set, the Query's query for fetching results is inherited from the global query. In a single page there is no much use in having an inherit Query (doesn't fetch anything), but instead a custom one. On the other hand in an archive or index template proper results are shown without taking into account any other previously explicitly set options (like the number of posts).

Some prior art is here: #27972, where templateSlug is passed as context and is used for now in QueryLoop to set the proper postType if we are in an archive template.

@annezazu annezazu added [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") and removed [Feature] Full Site Editing labels Jul 24, 2023
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Sep 8, 2023
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 [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants