To use the site module, import wixSiteFrontend
from the wix-site-frontend
module:
The APIs in wix-site-frontend
can only be used in front-end code.
Gets a code representing the site's currency.
The retrieved currency code corresponds to the currency that has been entered in the General Info section of your site's Dashboard.
The currency is used your site, apps (e.g. Wix Stores, Wix Bookings), and other Wix features.
import wixSiteFrontend from "wix-site-frontend";
// ...
const currency = wixSiteFrontend.currency; // "USD"
Gets information about the current page or lightbox.
import wixSiteFrontend from "wix-site-frontend";
// ...
const currentPage = wixSiteFrontend.currentPage;
/*
* {
* "name": "Home",
* "type": "static",
* "url": "/home",
* "isHomePage": true
* }
*/
Gets a code representing the site's language.
The retrieved language code corresponds to the main site language as found in the General Info section of your site's Dashboard.
Note: If you have a multilingual site, and it is being viewed in a language
that is not the main site language, the language
property still returns
the main site language. To work with the languages of a multilingual site,
use the Multilingual API.
import wixSiteFrontend from "wix-site-frontend";
// ...
const language = wixSiteFrontend.language; // "en"
Gets the site's regional settings.
The retrieved regional settings corresponds to the regional settings that has been entered in the General Info section of your site's Dashboard.
The regional settings are used to determine how numbers, dates, and currencies are displayed on your site.
import wixSiteFrontend from "wix-site-frontend";
// ...
const regionalSettings = wixSiteFrontend.regionalSettings; // "en-us"
Gets the site revision ID.
The site revision ID is a unique identifier for the current revision of your site. Each time you manually save your site or publish your site following a change, a new revision is created.
You can view and manage your site revisions in your Site History. You can use site monitoring to monitor and debug new revisions of your site.
Notes:
Since publishing your site may change the revision ID, the ID when previewing your site may be different than the ID for the published site.
The site revision ID is guaranteed to be unique, but not meaningful. Therefore, you cannot predict future revision IDs before they are created.
import wixSiteFrontend from "wix-site-frontend";
// ...
const revision = wixSiteFrontend.revision; // "4x2y"
Gets the site's timezone.
The retrieved timezone is the timezone that has been entered in the General Info section of your site's Dashboard.
The timezone is used your site, apps (e.g. Wix Stores, Wix Bookings), and other Wix features.
import wixSiteFrontend from "wix-site-frontend";
// ...
const timezone = wixSiteFrontend.timezone; // "America/New_York"
Gets the site display name.
Retrieves the site display name, which is the name that has been entered in the Website Settings section of the site's Dashboard.
function getSiteDisplayName(): string;
import wixSiteFrontend from "wix-site-frontend";
const siteName = wixSiteFrontend.getSiteDisplayName(); // "My Site"