description |
---|
Requesting all entries for a content type can be achieved by using the list method on the client's entries property. |
Requesting all entries for a content type can be achieved by using the list method on the client's entries property.
list(): Promise<PagedList<Entry>>
list(options: EntryListOptions): Promise<PagedList<Entry>>
Name | Type | Description |
---|---|---|
options | EntryListOptions | An object specifying the language, page options, ordering, fields to return and linkDepth. |
A Promise that will resolve with a Paged List of Entry
<ul id="entry_list">
</ul>
(function(Zengenti) {
var client = Zengenti.Contensis.Client.create();
$(function() {
client.entries.list().then(function(listOfEntries) {
for (var i = 0, ilen = listOfEntries.items.length; i < ilen; i++) {
var entry = listOfEntries.items[i];
$('#entry_list').append($('<li />').text(film.entryTitle));
}
}, function(error) {
console.error(error);
});
});
})(Zengenti);
<ul id="entry_list">
</ul>
(function(Zengenti) {
// Create a client
var client = Zengenti.Contensis.Client.create();
$(function() {
// specify the options
var options = {
language: 'fr-FR', // get french variations
order: ['entryTitle'], // order by entryTitle field
fields: ['entryTitle'], // only return entryTitle field
linkDepth: 1
};
// Get the list using the options
client.entries.list(options).then(function(listOfEntries) {
for (var i = 0, ilen = listOfEntries.items.length; i < ilen; i++) {
// loop through the entries adding their title to the list
var entry = listOfEntries.items[i];
$('#entry_list').append($('<li />').text(film.entryTitle));
}
}, function(error) {
console.error(error);
});
});
})(Zengenti);