You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -50,6 +51,18 @@ When you set the property to `false`, then app is rendered from the client side
50
51
51
52
> **Note:** For CSR mode, [stackSDK](#stacksdk) is required. Hence, we automatically switch mode to CSR when you pass this object. This config is provided to override the default behavior.
52
53
54
+
### `mode`
55
+
56
+
| type | default | optional |
57
+
| ------- | --------- | -------- |
58
+
| string |`preview`| Yes |
59
+
60
+
The `mode` property specifies whether the site is editable in the Live Preview or Visual Builder environment.
61
+
62
+
If set to `preview`, clicking the hovered edit button navigates to the Contentstack Live Preview panel.
63
+
64
+
If set to `builder`, clicking the Start Editing button navigates to the Contentstack Visual Builder. Note that the site will still function in the Live Preview panel even when set to 'builder'.
65
+
53
66
### `editButton`
54
67
The editButton object allows you to manage the "Edit" button both within and outside the Live Preview portal. It offers the following features:
55
68
- Enable/disable the "Edit" button
@@ -274,55 +287,29 @@ The `hash` property returns the live preview hash of the entry. It returns an em
The `setConfigFromParams` method allows you to set the configuration from the URL parameters. It accepts the URLSearchParams object as a parameter. This method is used in the SSR mode to set the live preview hash received from the URL.
Gatsby primarily fetches data using the [`gatsby-source-contentstack` plugin](https://www.gatsbyjs.com/plugins/gatsby-source-contentstack/). But, Live Preview currently works only on the [contentstack SDK](https://www.npmjs.com/package/contentstack).
290
+
## config
292
291
293
-
Hence, for Gatsby, we fetch the data from the contentstack SDK and store it in React state. Post that, we re-render the page using the `onEntryChange()` method. As the data format is different for the gatsby-source-contentstack plugin, it returns a prefix and the entry name in Camel case. Hence, we use `getGatsbyDataFormat()` to change the entry's name.
294
-
295
-
The `getGatsbyDataFormat()` method accepts the Contentstack `Stack` object as the first parameter and the prefix as the second. The prefix is set inside the `gatsby-config.js` file. The default value set for the prefix is `contentstack`.
292
+
The `config` property returns the following properties and their values:
0 commit comments