Open a different page
-
Complete the SDK quick start.
You can programmatically navigate from the currently open page to a different one so the SitecoreAI user can immediately start working with it, with no manual action required. This is useful to perform in response to some other action. For example, when you create a new page from the Marketplace app using the Authoring and Management GraphQL API, and then decide to redirect the user to the new page.
To open a different page:
-
In the SDK initialization code where you run the
useMarketplaceClienthook, after the Effect Hook, create a new mutation function:Replace the placeholder with the ID of a page.
-
In the
returnstatement, create a button that runs the mutation function, then save your changes: -
In the SitecoreAI Page builder, refresh the page, then open your Marketplace app.
-
In the Marketplace app, click Open another page.