Query by Tag

If you want to query all of the documents with a certain tag, then specify the document.tags.

All the documents with the tag “English”.

Copy
      api.query(
    Prismic.Predicates.at("document.tags", ['English'])
).then(function(content) {
    // content is the response object, content.results holds the documents
});
    
Copy
      $content = $api->query(
    Predicates::at('document.tags', ['English'])
);
// $content is the response object, $content->getResults() holds the documents
    
Copy
      content = api.query(
    Prismic::Predicates.at("document.tags", ["English"])
)
# content is the response object, content.results holds the documents
    

All of the documents with either the tag “Tag 1” or “Tag 2”.

Copy
      api.query(
    Prismic.Predicates.any('document.tags', ['Tag 1', 'Tag 2'])
).then(function(content) {
    // content is the response object, content.results holds the documents
});
    
Copy
      $content = $api->query(
    Predicates::any('document.tags', ['Tag 1', 'Tag 2'])
);
// $content is the response object, $content->getResults() holds the documents
    
Copy
      content = api.query(
    Prismic::Predicates.any("document.tags", ["Tag 1", "Tag 2"])
)
# content is the response object, content.results holds the documents