useStatamic(MultiTenancy)Site

Gitlab
Get the current multi-tenancy site identifier based on the site configuration of the current tenant.
Added since: v1.1.0
Last changed:
This composable will only be available when the following conditions are met:
This composable replaces useStatamicSite when the multiTenancy option is enabled.
Conveniently, you still use it as useStatamicSite in your project.

Usage

The useStatamicSite composable is used to get the current multi-tenancy site identifier based on the i18n locale properties or the multi-tenancy site identifier.

Basic example

pages/blogs.vue
<script setup lang="ts">
const 
site
=
useStatamicSite
();
</script>

Type Definition

function 
useStatamicSite
():
ComputedRef
<string | undefined>

API Reference

Return Value

ComputedRef<string | undefined>
The site identifier (language, or code).

The site identifier is retrieved from the site configuration of the current tenant.

Changelog

v1.1.0

on

#e4e1a19f

-

feat: added support for @nobears-front-end/nuxt-multi-tenancy