Login

Recover Your Password

Return to Product Support > Learning Center > Managing Add-ons > Add-on List and Instructions for Use > Theme Manager

Theme Manager

The Theme Manager lets you create a site templates based on html from a file or other websites. A common use is when you migrate your site to Contensive and need a quick way to convert a non-standard (non-html based) website to a standard html site.

Installation

To install the Theme Manager, select it in the Addon Manager and click install.

Setup

There is no setup.

Themes

A theme is a collection of html, css, js, etc that defines the look and feel for website, page or section. The theme manager helps you build themes and manage the resources it needs or creates.

There are three elements of the theme manager:

  1. Quick Import - use this tool to create the template, css, js, etc. resources you need by scraping them from an existing website.
  2. Theme Macros - use this tool to construct templates, layouts, css, jss, etc resources from static html files on the same website.
  3. Managing a Theme Collection (future) - use this tool to package the resulting theme to installation on another site.

Quick Import

Use this tool to create the template, css, js, etc. resources you need by scraping them from an existing website. Quick Import is part of the theme manager.

To use the Quick Import.

  1. Open Theme Manager and click the Quick Import tab at the top
  2. Enter a template name. This will be the name of the new template record created and must be unique each time Quick Import is run.
  3. In the source URL, enter the URL where the theme currently exists. For instance, if you published a static html site to www.mysiteonline.com enter www.mysiteonline.com into this field.
  4. Set the Import Method. 
    1. Save to File creates an html template file on the current site and sets up the template record to import that file every time is it used. 
    2. Save to Template sets up a template record with the data already in the record.
During the import, any issues encountered will be listed on the page. In most cases the import will continue and you can choose to resolve the issues manually. Typical issues are
  • Error Loading [...]. The remote server returned an error: 404 Not found - this means the file was not found on the source
  • The resource [...] could not be imported because the path [] is reserved. This will be the case if you try to import an Contensive site. It will not be able to save to reserved paths.

Theme Macros

Use this tool to construct templates, layouts, css, jss, etc resources from static html files on the same website. This process is more time consuming, but creates a repeatable process that can be re-run if the imported template changes.

The most common use for theme macros is when a designer creates static theme (set of templates) and uploads them to a staging site for approval. The developer can then write a set to macros that captures the parts of the theme and saves them to the appropriate places in the site. The developer can then work on add-ons for the site using the layouts, templates, style sheets, javascript files, etc created by the designer. When the designer makes changes to her original static files, the macro can be re-run and in many cased the development work will not be affected.

To use Theme Macros

  1. Create a Theme Import Macro. The Macro will contain one or more macro lines (like instructions) that when executed, will populate the systems theme related records from files in the wwwRoot.
  2. Create one or more Theme Import Macro Lines. These are the individual instructions that will be executed when the macro is run.

To Create a Theme Import Macro

  1. Go to Navigator >> Manage Addons >> Theme Manager >> click on the content Theme Import Macros
  2. Add a new record and give it a name

To Create Theme Import Macro Instructions

  1. Go to Navigator >> Manage Addons >> Theme Manager >> click on the content Theme Import Macro Lines
  2. Add a new record and give it a name
  3. Set the Macro to the macro you made for this project
  4. Set the Instruction. See Macro Instruction Reference for details about each instruction.
  5. Source (varies per instruction) - the source of the data to be manipulated. Depending on the instruction, this may be the name of a File name, a Layout record, a template record, a Copy record, a user defined variable, or a literal. The system determines what to use as follows:
    1. Attempts to use the input text as the name of an appropriate record (for example, the GetFile instruction would look for a file  with the name you entered)
    2. If previous attempts failed, it would check for a user defined variable that matches the input text. (for example, if you had previously saved a literal string to the user defined variable $pageHeader and you entered "$pageHeader" as the source for a SaveFile instruction, the contents previously saved to this variable would be saved to the file.
    3. If previous attempts failed, it would assume the text input is a literal string. For example, if you entered "Hello World" into the source of a SaveLayout instruction, that string would be saved into the layout record.
  6. Find/Selector (varies per instruction) - a portion of the source that will be used in the instruction. For instance, an OpenLayout instruction with a valid source might hold an html layout. If the Find/Selector contains "#ClientList" then the only part of the html layout that will be stored is the inner Html of a tag with ID="ClientList". For a FindReplace instruction, this is what will be searched out to be replaced.
  7. Replace (varies per instruction) - for the FindReplace instruction, this is what will be replaced into the text input
  8. Destination (varies per instruction) - this is where the resulting string will be stored. Depending on the instruction, this may be the name of a File name, a Layout record, a template record, a Copy record, or a user defined variable. To save to a user definied variable, use the Append instruction.
  9. Alpha Sort Order - used to determine the order of execution when the macro is run. If two lines have the same Sort Order, the one created first will be executed first.
To Run a Theme Import Macro Instructions
  1. Open Theme Manager and click the Theme Macros tab at the top
  2. Next to the Macro you want to run, click Execute

More Information