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.
To install the Theme Manager, select it in the Addon Manager and click install.
There is no setup.
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:
- Quick Import - use this tool to create the template, css, js, etc. resources you need by scraping them from an existing website.
- Theme Macros - use this tool to construct templates, layouts, css, jss, etc resources from static html files on the same website.
- Managing a Theme Collection (future) - use this tool to package the resulting theme to installation on another site.
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.
- Open Theme Manager and click the Quick Import tab at the top
- 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.
- 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.
- Set the Import Method.
- 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.
- 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.
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.
To use Theme Macros
- 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.
- 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
- Go to Navigator >> Manage Addons >> Theme Manager >> click on the content Theme Import Macros
- Add a new record and give it a name
To Create Theme Import Macro Instructions
- Go to Navigator >> Manage Addons >> Theme Manager >> click on the content Theme Import Macro Lines
- Add a new record and give it a name
- Set the Macro to the macro you made for this project
- Set the Instruction. See Macro Instruction Reference for details about each instruction.
- 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:
- 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)
- 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.
- 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.
- 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.
- Replace (varies per instruction) - for the FindReplace instruction, this is what will be replaced into the text input
- 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.
- 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
- Open Theme Manager and click the Theme Macros tab at the top
- Next to the Macro you want to run, click Execute