getSiteStructure( )


Returns information about the site's pages, prefixes, and lightboxes.

The returned SiteStructure object is a flattened representation of the site. The structure does not include the headers and links from the site's Pages menu.

Method Declaration
Copy
function getSiteStructure(): SiteStructure;
Request
This method does not take any parameters
Returns
Return Type:SiteStructure
Get information about the site's pages, prefixes, and lightboxes

This example gets the structure of the site with the following in its pages menu: Site Structure

JavaScript
import wixSiteFrontend from "wix-site-frontend"; // ... const structure = wixSiteFrontend.getSiteStructure(); /* * { * "pages": [ * { * "name": "Home", * "type": "static", * "url": "/home", * "isHomePage": true * }, * { * "name": "Page 1", * "type": "static", * "url:" /page-1" * }, * { * "name": "Page 2", * "type": "static", * "url": "/page-2" * }, * { * "name": "Parent Page", * "type": "static", * "url": "/parent-page" * }, * { * "name": "Child Page", * "type": "static", * "url": "/child-page" * }, * { * "name": "router-page", * "type": "template", * "prefix": "router" * }, * { * "name": "MyCollection (Title)", * "type": "template", * "prefix": "MyCollection" * }, * { * "name": "MyCollection (All)", * "type": "template", * "prefix": "MyCollection" * }, * { * "name": "Dashboard Page", * "type": "static" * }, * { * "name": "Shop", * "type": "template", * "url": "/shop", * "applicationId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" * }, * { * "name": "Product Page", * "type": "template", * "url": "/product-page", * "applicationId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" * }, * { * "name": "Thank You Page", * "type": "template", * "url": "/thank-you-page", * "applicationId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" * }, * { * "name": "Cart", * "type": "template", * "url": "/cart", * "applicationId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" * }, * { * "name": "Members", * "type": "template", * "url": "/members", * "applicationId": "14ad9202-3dd3-128a-57bd-e5675fd7e313" * } * ], * "prefixes": [ * { * "name": "router", * "type": "router", * "prefix": "/router" * }, * { * "name": "MyCollection", * "type": "dynamicPages", * "prefix": "/MyCollection" * }, * { * "name": "MyCollection", * "type": "dynamicPages", * "prefix": "/MyCollection" * }, * { * "name": "Shop", * "type": "app", * "prefix: "/shop", * "applicationId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" * }, * { * "name": "Product Page", * "type": "app", * "prefix": "/product-page", * "applicationId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" * }, * { * "name": "Thank You Page", * "type": "app", * "prefix": "/thank-you-page", * "applicationId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" * }, * { * "name": "Cart", * "type": "app", * "url": "/cart", * "applicationId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" * }, * { * "name": "Members", * "type": "app", * "prefix": "/members", * "applicationId": "14ad9202-3dd3-128a-57bd-e5675fd7e313" * } * ], * "lightboxes": [ * { * "name": "Welcome (Full Screen)" * } * ] * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?