method

AdminLoadContext.Global

Read a global's saved values as the current admin user.

Example

go
settings, err := ctx.Global("site-settings", ridu.FindOptions{})

Arguments

ArgumentTypeDescription
slugstringSlug of the global to read.
optionsFindOptionsSelection and population settings. Identity and locale come from the request.

Returns

The readable global values, or an error if the read cannot complete.

(store.Document, error)

How it works

Uses the normal content operation with the request's permissions, field redaction, hooks, and content locale. Return the error from your loader so the admin can offer retry.

Full signature

Related types

  • AdminLoadContext

    Read content for the signed-in user while a Go admin loader runs.

  • FindOptions

    Projection, population, authorization, draft, trash, and locale controls for one read.

  • Document

    A stored document with status and version metadata.

Related guides