Skip to main content

List entries by content type

Log in to add to favourites

Deprecation warning

We recommend using search rather than the list method. Search is more performant and offers more flexibility than the list method.

Requesting all entries for a content type can be achieved by using the list method on the client's entries property.

list(contentTypeId: string): Promise<PagedList<Entry>>

list(options: EntryListOptions): Promise<PagedList<Entry>>

Parameters

Name Type Description
contentTypeId string The id of the content type
options EntryListOptions An object specifying the content type id, language, page options, ordering, fields to return and linkDepth.

Returns

A Promise that will resolve with a Paged List of Entry

Example - using content type id

JavaScript
ContensisClient.entries.list('<content-type-id>').then(function (entryList) {
  entryList.items.forEach(item => (
    console.log(item.entryTitle)
   ))
});

Example - using entry list options

JavaScript
ContensisClient.list
.get({
    id: '<content-type-id>',
    language: 'fr-FR',
    linkDepth: 2,
    fields: ['title', 'overview']
})
.then(function (entryList) {
    entryList.items.forEach(item => (
      console.log(item.title);
      console.log(item.overview);
   ))
});

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request