Remote Page Templates provide a way to host Page Templates on a remote server, as opposed to within the CMS itself.
This can be useful for a variety of use cases. For instance, if the CMS is integrated into an existing web application, version control may be improved by keeping the Page Templates in the same source code repository as the web application.
Remote Templates can be set up as follows:
- Add the Remote Page Template under the Site "Page Templates" tab
- Set a Name and Title for the new template
- Enter the full URL of the Remote Template in the URL field
- Configure additional cms-page-config JSON properties by clicking the edit button under the Config column.
- Modify the Remote Template HTML, launch the CMS Editor script on startup:
- Download the jsHarmonyCmsClient.min.js library into your project. Alternatively download from the jsharmony-cms-sdk-clientjs GitHub page or NPM
- Generate the Integration Code
- Open the Site's Deployment Target that will be used with the Remote Template
- Select the "Integration Code" tab
- Select the Environment: "Remote Template"
- Copy the Integration Code code into the HEAD tag of your Remote Template
* Be sure to update the path to jsHarmonyCmsClient.min.js to where the file was saved in step 2(a)
* Keep the "removeOnPublish" class in the Launcher script tags, so that the Launcher will not be included in the published pages
<script type="text/javascript" class="removeOnPublish" src="path/to/jsHarmonyCmsClient.min.js"></script>
<script type="text/javascript" class="removeOnPublish">
jsHarmonyCmsClient({"access_keys":["*****ACCESS_KEY*****"]});
</script>
- Follow the steps under Creating Page Templates to define the editable areas