Using the Query Editor on a Terms Query

I have a terms query loop on a product page to show a set of terms with fields on the page. I am trying to use the new query editor so that I can order the terms by a specific meta field but I cannot seem to get the query editor to work. Not sure if I’m missing something or just don’t understand it enough. Here’s a screenshot of the existing query loop settings:


And here is the code I’ve attempted to use in the query editor:

$taxonomy = '{post_terms_variation}';
$orderBy = '{pods_variation_order_by}';
$postId = '{post_id}';

return [
	'taxonomy' => [$taxonomy],
  'orderby' => 'meta_value_num',
  'meta_key' => [$orderBy],
  'order' => 'ASC',
  'object_ids' => [$postId],
];

Any assistance would be appreciated.

Thank-you

2 Likes

Hey @Mundy - Did you ever manage to find a solution to this?

No. I didn’t use the query editor, I added a code block and used the query var filter.

https://academy.bricksbuilder.io/article/filter-bricks-terms-query_vars/

1 Like