Global query context?

Hi, assumed I am just new in wordpress,

For example from Gutenberg query loop block:

Inherit query from template
Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently.

How can to debug and check the global query context, or print it as json over tangible block?

This following what I need. Using L&L with Search and Filter Pro - #5 by eliot

<Loop>
  <Field title />
</Loop>

I just wish I can getting more context. Like hardcode value of

<Loop type=post current=search>
  <Field title />
</Loop>

So i can confirm the value is instead references from archive or search…

Hi @onstarrynight, welcome to the forum!

L&L is not designed to be a tool that allows analyzing queries on your WordPress site. It’s designed to do two things related to queries:

  1. Create queries by specifying query parameters like <Loop type=post count=5>)
  2. Loop through values from an existing query by using the tag on its own like <Loop>

If you’re not sure what queries are occurring on a page, you could use a tool like Query Monitor to get more information.

If you need help querying some particular data in some specific way, you can read about the Loop tag and the specific query parameters available for each loop type (such as the post loop). If you still can’t figure it out, feel free to ask on the forum for help and describe in detail what data you’re trying to display and what templates you’ve tried.

This sounds similar to the feature called Locations, which is part of the template type Layout. It’s a way to match a set of location rules to the global query, to determine which layout template to load.

These rules have the same structure as conditional rules for the If tag, with subject, operator, value. So it might be possible to add a new attribute location that uses this function to evaluate a given location rule. It could look like…

<If location=search>
  Search result
<Else if location=archive />
  Post archive
</If>

OK, I’ve made a note of this idea: If tag: Add rule `location` to match location rules to global query context · Issue #120 · TangibleInc/template-system · GitHub