Search.../

getSiteStructure( )

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

Description

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.

Syntax

function getSiteStructure(): SiteStructure

getSiteStructure Parameters

This function does not take any parameters.

Returns

An object that contains information about the site's pages, prefixes, and lightboxes.

Return Type:

SiteStructure
NAME
TYPE
DESCRIPTION
pages
Array<StructurePage>

The pages of the site. Pages can be regular pages, dynamic pages, router pages, or pages from an app.

prefixes
Array<Prefix>

The prefixes of the site's routers and dynamic pages.

lightboxes
Array<StructureLightbox>

The site's lightboxes.

Related Content:

Was this helpful?

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

Copy Code
1import wixSiteFrontend from 'wix-site-frontend';
2
3// ...
4
5const structure = wixSiteFrontend.getSiteStructure();
6
7/*
8* {
9* "pages": [
10* {
11* "name": "Home",
12* "type": "static",
13* "url": "/home",
14* "isHomePage": true
15* },
16* {
17* "name": "Page 1",
18* "type": "static",
19* "url:" /page-1"
20* },
21* {
22* "name": "Page 2",
23* "type": "static",
24* "url": "/page-2"
25* },
26* {
27* "name": "Parent Page",
28* "type": "static",
29* "url": "/parent-page"
30* },
31* {
32* "name": "Child Page",
33* "type": "static",
34* "url": "/child-page"
35* },
36* {
37* "name": "router-page",
38* "type": "template",
39* "prefix": "router"
40* },
41* {
42* "name": "MyCollection (Title)",
43* "type": "template",
44* "prefix": "MyCollection"
45* },
46* {
47* "name": "MyCollection (All)",
48* "type": "template",
49* "prefix": "MyCollection"
50* },
51* {
52* "name": "Dashboard Page",
53* "type": "static"
54* },
55* {
56* "name": "Shop",
57* "type": "template",
58* "url": "/shop",
59* "applicationId": "1380b703-ce81-ff05-f115-39571d94dfcd"
60* },
61* {
62* "name": "Product Page",
63* "type": "template",
64* "url": "/product-page",
65* "applicationId": "1380b703-ce81-ff05-f115-39571d94dfcd"
66* },
67* {
68* "name": "Thank You Page",
69* "type": "template",
70* "url": "/thank-you-page",
71* "applicationId": "1380b703-ce81-ff05-f115-39571d94dfcd"
72* },
73* {
74* "name": "Cart",
75* "type": "template",
76* "url": "/cart",
77* "applicationId": "1380b703-ce81-ff05-f115-39571d94dfcd"
78* },
79* {
80* "name": "Members",
81* "type": "template",
82* "url": "/members",
83* "applicationId": "14ad9202-3dd3-128a-57bd-e5675fd7e313"
84* }
85* ],
86* "prefixes": [
87* {
88* "name": "router",
89* "type": "router",
90* "prefix": "/router"
91* },
92* {
93* "name": "MyCollection",
94* "type": "dynamicPages",
95* "prefix": "/MyCollection"
96* },
97* {
98* "name": "MyCollection",
99* "type": "dynamicPages",
100* "prefix": "/MyCollection"
101* },
102* {
103* "name": "Shop",
104* "type": "app",
105* "prefix: "/shop",
106* "applicationId": "1380b703-ce81-ff05-f115-39571d94dfcd"
107* },
108* {
109* "name": "Product Page",
110* "type": "app",
111* "prefix": "/product-page",
112* "applicationId": "1380b703-ce81-ff05-f115-39571d94dfcd"
113* },
114* {
115* "name": "Thank You Page",
116* "type": "app",
117* "prefix": "/thank-you-page",
118* "applicationId": "1380b703-ce81-ff05-f115-39571d94dfcd"
119* },
120* {
121* "name": "Cart",
122* "type": "app",
123* "url": "/cart",
124* "applicationId": "1380b703-ce81-ff05-f115-39571d94dfcd"
125* },
126* {
127* "name": "Members",
128* "type": "app",
129* "prefix": "/members",
130* "applicationId": "14ad9202-3dd3-128a-57bd-e5675fd7e313"
131* }
132* ],
133* "lightboxes": [
134* {
135* "name": "Welcome (Full Screen)"
136* }
137* ]
138* }
139*/
140