CMSCart Manual





Templates

Introduction to Templates

Templates can be thought of as a spreadsheet with rows and colums that make cells. The same terminology is used in this system. Within any cell of a template can be content or another template. Templates, template rows, template columns and template cells all have properties. Since master templates are global to the page, they additionally have global properties.

Master Templates

Templates can be set to be master templates. Each page should have one master template. However, several pages within a site can use the same master template, if wanted. Or some pages can use different master templates because they need to be designed differently. Keep in mind though, that while several pages may use the same template, they can actually have different content for their specific page! For more about content see that section. In this way, you do not need to copy or create a separate template for each page when the design is the same. After all, most pages of a site have the same design usually and so one template can be used for all of them while being able to present different content for each page. This is one of the big advantages to having templates! If a master template is set as a page's template, this template cannot be "unmastered" until there are no pages using it (the option for switch to a non-master is greyed out in this case). Also,when a master template is selected for a page, a warning containing all pages currently using that master template is displayed above the template design.

Creating and Selecting Template

To create a template, select the site you want to work on in Administration Home, and click the Template Design link to go to the Template Design area. In the Update Site Template Information box, enter the name of the new template and click Add. You can now start working with this template. Keep in mind that this new template can only be used within this site. Ways to get around this can be found in the Copying Templates section. You can view and select any of the templates in your site by using the "Template" dropdown. Notice that templates are split into Master Templates and Other Templates (Other Templates being any non-master templates).

A note about template naming: Although you are free to name your templates whatever you please, it is suggested that for the sake of easy development, you name the templates and content areas something meaningful to the layout of the site. For instance, if you are creating a template is the main menu that is going to hold the title, you might name the template "mainmenutitle". That way when looking at the template in design view, you are quicker to see which templates contain which parts of the site. It makes development quick and easy!

Template Properties

Once you select a template, clicking on its name will bring you into its properties. Also, at the top there is its global properties to go into, if it is a master template. Clicking on a row name, column name or cell name goes into their properties. The properties that each of these have are ones appropriate to them and are based on underlying HTML and CSS standards for web page creation. To see a list of these properties and their descriptions see the section on CSS Properties.

Template Special Properties

Templates have four special properties: rows, columns, master, and lock. You can add as many rows and columns as you like to a template; however, each template should have at least 1 column and 1 row so that the template has a cell to put content or another template in. The master property is used to set a template as a master template. Once you set this property, there is a warning message displayed that the template cannot be unmastered, if it is being used on pages within the site. See the section on Master Templates for more information. Locking a template involves restricting access to the properties of the locked template as well as it's rows, columns, and cells. Once you lock a template, you will see that in template design, the links for it and it's rows, columns, and cells will be red to indicate they are locked. You will not be able to modify any properties of the locked areas until you go back to the locked template and unlock it.

Global Template Properties

Properties set at the global level will carry on through the whole template, unless another property set farther down overrides it. Global Template Properties are similar to regular template properties, with a few additions.

Debug Switch: Setting the debug switch to "Yes" will display comments from the Content Producer in the HTML source code.

Webstore Properties

Default Emails

Default emails will be used in the Buy, Sell, and Cart Process elements when the element-specific emails are not set.

ERP Properties

These properties will be used to connect to the ERP for sales lists, items, etc. If these properties are not set properly, you will recieve error messages on the front end whenever CMSCart tries to connect to an ERP. As well as setting the database connection to the ERP, you also need an API to communicate with the ERP using a variety of functions. To include such an API, use the ERP API Flag to tell CMSCart to include an API file, and set the ERP API Path to tell CMSCart where to find the API. Read the section on ERP Communication for more information on using the ERP API.

**Important Note About Connecting to ERP**
There are several places that can connect to sales system(s) in the ERP. All of them must be set properly. The following is a list of those places:

Note that when using the sales categories and items and the search, the two pages listed above, named Items and Search must be present and called exactly that. CMSCart is hard wired to call these exactly named pages when those mechanisms are invoked.

Global Link Properties

Global link properties are a quick way to set a link style that can be used throughout the entire template. So if you know that you are using one primary link style in your site, it may be quicker to set the global link properties once instead of repeating the properties for each individual link. Note that if you set any of the link properties in the idividual elements, none of these globals will be used for that element. For details on the link properties, see the Element Properties section.

Sub-Templates

Any template can have sub-templates. These are just other templates that you have told the template to use within it. Those sub-templates can have sub-templates within them too, and so on. In this way, very complex designs can be made. For information on how to add a sub-template, see the Cell Special Properties. Another powerful feature offered by sub-templating is the ability to use one sub template across many master templates. This allows for areas to appear in various places on different master tempalates, but only require that they have their properties and shared content to be set only once over multiple instances. Each of the pages can have specific content though if wanted.

Combining Templates

Keep in mind that properties at a lower sub-template level will override properties above. That is the way the web development standards work. For instance, if you center-align a template, but left-align it's cell, the cell content will be left-aligned, not centered. This is also a useful concept when setting the size of tables and content areas.

Copying Templates

If you go into Template Design, not through Page Design, you will have access to the template copying facilities of the system. Copying a template entails copying its structure along with all of it's properties. To select the template you want to copy, select it from the From Template dropdown in the Copy Template box. Notice that all templates from all sites are in this dropdown, grouped by sitename. This means that you can copy any templates from your sites into the current site. Once you have selected the template you want to copy, enter the template name you want to copy it into in the To Template entry. Click Copy and then click Next.

You will be presented with a chart that outlines the structure of the template, grouped by levels. Each template and content area is listed in the structure it exists in the site, with a text box below it for the new name. To copy a template, you need to at least rename the top level template, so it has been filled in for you with the To Template name you entered above. So click Save Level 1 and that level will be saved and you will move to Level 2. If you rename the templates, you will be able to continue to the next level and continue renaming. But if you leave any of the text areas as the original names, the copying stops there and any remaining templates and content areas below that template will not be copied, just reused within the copied template. This is handy when you want the same top template for instance, but want to change the center design. You can pick and choose how much of the template you wish to copy.

Once you have saved all levels, you can go back to the Template dropdown and you will see all the copied templates there.

Template Reports

If you are in Template Design, not through Page Design, you will have access to the template reporting facility. This is a handy facility for seeing the set properties of your site. To use this, first select the template you want to get a report on, then click Select. This will then enable the report button which, when clicked suprisingly generates a report. You will now see a list of all the properties that are set in the entire template and it's sub templates. Only properties that are set will display, so it is easy to see what you have set. At any time you can click one of the templates or content areas and you will be redirected to that template's property edit area or the Content Producer for that content area.

Cell Special Properties

It is only at the cell level where either a sub-template can be selected or content can be added. In the cell properties, there are four fields that important to this process.