Simple Content Folder Integration Tutorial

How it works:

  • Generate static HTML pages in a subfolder of the site, based on static HTML templates.


Simple Content Folder Limitations:

  • No Redirect Support
  • No Built-in Single-Page / SPA Support


Overview:

The simple content folder is the easiest integration method - serving fully generated HTML files out of a public subfolder of the client-side JS application.  This does not require installing the jsHarmony CMS SDK.


Integration:

  1. In the jsHarmony CMS, on the Sites tab, create a new Site

  2. In the Site Settings, add a Deployment Target:
    1. Configure the Deployment Target to publish to a folder in the client-side JS application
    2. Set the URL Prefix to "/" if CMS files will be available off the root of the target domain, or otherwise set URL Prefix to the path prefix

  3. Create a Page Template:
    1. Local Page Templates can be defined in the CMS, by using the Site's SFTP
    2. Remote Page Templates can be defined in a subfolder of the client-side JS application, and linked to the CMS in the Site Settings "Page Templates" tab.
      :: Configuring Remote Page Templates

  4. Add CMS content and publish to the Deployment Target, generating HTML files in the subfolder of the client-side JS application

  5. Add a route to the server hosting your client-side JS application to serve the files:
    //Node.js Server Example:
    app.use('/', express.static('path/to/published_files'));
    # Apache Server mod_rewrite Example
    # :: Serve a subfolder as if it was the root of the site
    RewriteCond %{DOCUMENT_ROOT}/published_files_subfolder/%{REQUEST_URI} -f
    RewriteRule ^(.*) /published_files_subfolder/$1 [L]
    RewriteCond %{DOCUMENT_ROOT}/published_files_subfolder/%{REQUEST_URI} -d
    RewriteRule ^(.*) /published_files_subfolder/$1/ [L]

 

Loading
Loading