Setup Contemple Hub
In order to use Contemple with your website, you only need a webserver with PHP. To connect the App with a Website, the cthub folder have to be uploaded to the Webserver.
Contemple Hub handles the theme installation, publishing and passwords for the Contemple app.
To set the theme, copy your theme.zip file into the cthub folder and modify the install.xml file. Then upload the modified cthub folder to your Webserver.
File: cthub/install.xml
<ct>
<templates>
<template
name="com.yourdomain.v1"
src="./theme.zip"
version = "1.0.0"
date="01-01-2020"
homeAreaName="Home"
uploadScript="https://yourdomain.com/cthub/cthub.php" />
</templates>
</ct>
Here the name, version, src and uploadScript are set to yourdomain.com. The uploadScript handles the installing and publishing with Contemple.
If the website is not in the root directory, you also have to modify the server_path variable inside the cthub.php file.
It is possible to have multiple Themes on the same Domain. In the above example is only one theme wich can be installed by entering the url https://yourdomain.com/cthub/ in Contemple.
To add more Themes, just add more template nodes in the install.xml file. Contemple then displays a list with all themes to choose for installing locally.
File: cthub/install.xml
<ct>
<templates appName="YourDomain-CMS" version="1.0.0">
<template
name="app.contemple.demo"
src="../../template-demo-1.0.0.zip"
version = "1.0.0"
date="01-01-2020"
uploadScript="https://yourdomain.com/cthub/cthub.php" />
<template
name="SubDomain_Theme"
src="../../template-sub-domain-1.0.0.zip"
version = "1.0.0"
date="01-01-2020"
localSharedObjectId="com.yourdomain.sub.v1"
uploadScript="https://yourdomain.com/cthub/cthub-sb.php" />
</templates>
</ct>
In this install.xml are two Themes available. The file cthub-sb.php is a copy of the cthub.php with the server_path set to the sub domain.
The following Table shows the most common attributes for template nodes:
Name
Description
name
The name of the theme. The name have to match the name from the theme's config.xml file.
hashCompareAlgorithm
The publishing checks the file hashes to compare files. The hashCompareAlgorithm can be changed here if the default md5 is not working on your webserver. It can be set to: sha256, sha224 and md5
localSharedObjectId
The id of the local store object. Default is app.contemple.1.0.6. In order to use multiple themes from the same cthub, the localSharedObjectId should be different for every theme.
localUploadFolder
Set the folder of the project directory to upload Default is min. It can be set to raw or min
richTextCssClasses
comma separated list of css class names to select in the rich text editor.
src
Url to the theme.zip file. If the url is absolute, the zip file can be accessed online wich may cause security issues.
If the path is relative, the zip file is sent from the hub with password protection, and it can be stored in a directory one hierarchy above the website root.
uploadScript
Url to the cthub.php file. To use multiple themes on the same server, the uploadScript have to be different in every theme. Copy and rename the cthub.php file and change the server_path to the theme's website folder
version
The version of the theme from the src attribute. Default is "0.0.0"