You can enable contextual editing of an SPA to allow content contributors to browse to the app in Edit mode in Jahia, navigate inside the app, and edit content directly in the app.
If your SPA resides on a standalone application, you should move or embed the SPA inside a Jahia module. For example, move the SPA directly inside your [spa_name]-dx-module
.
For example, if your SPA consists of a JavaScript SPA and simple bootstrapping HTML, you can copy the HTML code into a page template and then create a Jahia page named spa_name. Then, the JavaScript will be bundled inside the module.
To create a page template:
After creating your page template, modify the application so that you can open it for editing in Jahia Edit mode.
The app can detect that is in an edit frame by checking for the presence of window.parent.jahiaGWTParameters
. If Edit mode is detected, you should switch the router to memory or hash to avoid conflicts with the edit frame.
Finally, you can add Edit buttons to specific sections of the application. Modify the button so that it calls:
window.parent.authoringApi.editContent("/sites/digitall/contents/destinations/xxx", '',["jnt:content"], ['gant:destination'])
Where:
Copyrights © 2002-2021 All Rights Reserved by Jahia Solutions Group SA