method
AdminLoadContext.Global
Read a global's saved values as the current admin user.
Example
settings, err := ctx.Global("site-settings", ridu.FindOptions{})Arguments
| Argument | Type | Description |
|---|---|---|
slug | string | Slug of the global to read. |
options | FindOptions | Selection 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
func (ctx AdminLoadContext) Global(
slug string,
options FindOptions,
) (store.Document, error)Related types
AdminLoadContextRead content for the signed-in user while a Go admin loader runs.
FindOptionsProjection, population, authorization, draft, trash, and locale controls for one read.
DocumentA stored document with status and version metadata.