Namespaces

ovok.content

Search and manage managed content items by type and language.

  • Stable unknown
  • Release candidate since 0.4.49-rc.4
  • Development since 0.4.49-dev.517+4645a0a

The older managed-content routes under cms: items grouped by type and language, with a key for each item. Use it to read and edit content. For published delivery to apps, prefer ovok.cms.

Search and read items

const found = await ovok.content.search('blog', 'en');
const item = await ovok.content.retrieve('blog', 'en', 'welcome');
  • type is a content type such as blog, video, audio, template or export-template.
  • search takes an optional query as its third argument. It returns the server's search envelope, not a PagePromise.
  • Calls GET cms/{type}/{language} and GET cms/{type}/{language}/{key}.

Create, replace and delete

await ovok.content.create('blog', 'en', body);
await ovok.content.update('blog', 'en', 'welcome', body);
await ovok.content.delete('blog', 'en', 'welcome');
  • update is a full replace (PUT). body has the same shape for create and update.

Pair translations

const pairs = await ovok.content.map('blog', 'de');
  • Pairs each default-language item with its translation in the given language.

Copy from the parent project

await ovok.content.copyFromParent('blog', 'en', 'welcome');
await ovok.content.copyAllFromParent('blog', 'en');
  • Both resolve to { success }. They only make sense for a child project.

Reference

Last updated on

On this page