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

<?xml version="1.0" encoding="utf-8" ?>
<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

<?xml version="1.0" encoding="utf-8" ?>
<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.

name = "app.contemple.demo"

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

hashCompareAlgorithm = "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.

localSharedObjectId = "com.your-domain.v1"

localUploadFolder

Set the folder of the project directory to upload Default is min. It can be set to raw or min

localUploadFolder = "min"

richTextCssClasses

comma separated list of css class names to select in the rich text editor.

richTextCssClasses = "text-left,text-center,text-right,xs,s,m,l,xl,jumbo"

src

Url to the theme.zip file. If the url is absolute, the zip file can be accessed online wich may cause security issues.

src = "https://yourdomain.com/cthub/theme-v1.zip"

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.

src = "../../../private-dir/theme-v1.zip"

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

uploadScript = "https://yourdomain.com/cthub/cthub-theme2.php"

version

The version of the theme from the src attribute. Default is "0.0.0"

version = "1.0.0"