Learn how Scrivito CMS can help you deliver amazing digital experiences
See Scrivito CMS in action
New in 1.22.0

currentWorkspace()

Returns the current working copy.

const workspace = await Scrivito.load(() => Scrivito.currentWorkspace());

Scrivito.currentWorkspace returns the current working copy with its ID and title.

Params

None

Returns

A Workspace instance.

Example

Render the title of the current working copy:

const CurrentWorkingCopyTitle = Scrivito.connect(() => { const workspace = Scrivito.currentWorkspace(); if (workspace.id() !== 'published') { return <div>{workspace.title()}</div>; } return null; });