@ovok/native/cms
Hooks that read CMS content, locales and translations.
- Stable unknown
- Release candidate since 1.16.1-rc.3
- Development since 1.16.1-dev.2111+9796905
Hooks that read CMS content, locales and translations.
Import from @ovok/native/cms.
Hooks
useCmsDocument()
function useCmsDocument<T>(
collection,
slug,
options?
): OvokQueryState<T>;Fetches one CMS document by collection and slug, in the current CMS locale unless options.locale is set; disabled while slug is undefined.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
collection | string |
slug | string | undefined |
options? | CmsReadParams |
Returns
OvokQueryState<T>
useCmsDocuments()
function useCmsDocuments<T>(collection, options?): OvokQueryState<Page<T>>;Fetches the documents of a CMS collection, in the current CMS locale unless options.locale is set.
Type Parameters
Parameters
| Parameter | Type |
|---|---|
collection | string |
options? | CmsListParams |
Returns
OvokQueryState<Page<T>>
useCmsLocale()
function useCmsLocale(): string;Returns the current i18n language as a CMS locale.
Returns
string
useCmsTranslations()
function useCmsTranslations(options?): OvokQueryState<OvokTranslations>;Loads the CMS translations for the current or given locale and merges them into the app's i18n resources.
Parameters
| Parameter | Type |
|---|---|
options? | CmsReadParams |
Returns
OvokQueryState<OvokTranslations>
useLegalPage()
function useLegalPage(slug, options?): OvokQueryState<OvokCmsDocument>;Fetches a legal page by slug, in the current CMS locale unless options.locale is set; disabled while slug is undefined.
Parameters
| Parameter | Type |
|---|---|
slug | string | undefined |
options? | CmsReadParams |
Returns
OvokQueryState<OvokCmsDocument>
useReleaseNotes()
function useReleaseNotes(options?): OvokQueryState<Page<OvokCmsDocument>>;Fetches the release notes, in the current CMS locale unless options.locale is set.
Parameters
| Parameter | Type |
|---|---|
options? | CmsListParams |
Returns
OvokQueryState<Page<OvokCmsDocument>>
Last updated on