Resolve an entry link
Log in to add to favouritesCall the entries.resolve() method in our delivery client to get an entry or a list of entries with all content fields resolved
Call signatures
resolve(entry: Entry, fields?: string[]): Promise<Entry>;
resolve(entryArray: Entry[], fields?: string[]): Promise<Entry[]>;
resolve(pagedListOfEntries: PagedList<Entry>, fields?: string[]): Promise<PagedList<Entry>>;
Parameters
Name | Type | Description |
---|---|---|
entry | Entry | An entry object containing the sys.id of the entry to resolve |
entryArray | Entry [...] | An array of entry objects as above |
pagedListOfEntries | PagedList<Entry> | A paged list containing entry objects as above |
fields | string [...] | The ids of the fields inside the entry containing linked content to resolve |
Returns
A Promise that will resolve with an Entry, an Entry array, or a Paged List of Entry
Example
client.entries
.get('<entry_id>')
.then(function (entry) {
// This is pointless as we will be resolving the entry we
// have just returned with the call to .get()
console.log(client.entries.resolve(entry, ["actor", "studio"]));
});
client.entries
.list('<content_type_id>')
.then(function (entryList) {
entryList.items.forEach(item => (
//
console.log(client.entries.resolve(item))
))
});