Field - Content Relationship - exclude tag

Hello everyone!

I'm wondering if there is a way to configure a Content Relationship field in order to query every item that doesn't have a specific tag.

Here is my use case :
My client needs a way to select specific projects and order them.
So I've been using a Group Field with a Content Relationship for a while now and it works as expected.
But now that he's got several dozens of projects, it's quite complicated to quickly add new projects without searching for the new one.
Another solution would be to filter by some tag like "new", this tag would be added during content creation but it adds one more action to make it work.

Any ideas?
Thanks

Hello @ldvc.btx, the solution you propose is a good one. Another one that also requires a bit more setup is, you can add a Boolean field set to false to prevent a document from appearing in the results. Here's an example:

this.$prismic.client.query([
  this.$prismic.Predicates.at('document.type', 'page'),
  this.$prismic.Predicates.fulltext('page', 'content')
  this.$prismic.Predicates.not('document.searchable', false)
]).then((response) => {
  // response is the response object, response.results holds the documents
});

Thanks for the heads up !

Your solution would be for a query outside Prismic Dashboard right ?
Regarding my issue, the results are Content Relationship results (on the dashboard) and I don't see a way to use this kind of queries.

Thanks

Oh, I understand. No, there's no way of filtering out documents in the search bar for the moment. I'll add this as a feature request.

1 Like