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
- Webstore System Code: This code will display in any emails sent from the webstore in order to track where the emails originated. Put something meaningful here so that you will be able to identify
the webstore
- Webstore Type: this field is used in several areas of the webstore, including the Buy and Sell areas and the various Cart pages. The Webstore Type is set to either Shopping Cart or Order Quote.
The effects of setting this property are purely display - for instance, in the View Cart area, if the Webstore Type is Shopping Cart, the Add button will say "Add to Shopping Cart", and if the Order
Quote selection is chosen, this same button will display "Add to Order Quote" instead
- Zero Price Message: entry field that controls the message that appears when the price of an item is 0 (zero). The default is to display 0, but an example of a good message to put here is "Call".
Keep in mind that a Zero Price is different from No Price, in that 0 (zero) is still a price
- No Price Message: entry field that controls the message that appears when no price can be found for an item. An example of a good message to put here is "Call"
- Order Message: This message will display when the customer finishes submitting an order
- Item Code Header: When set, this is the heading that will show throughout the items and cart in place of Item Code. For example, Part No. or Part #
- Alt Code Header: When set, this is the heading that will show throughout the items and cart in place of Ind. Code. For example, Alternate Code
Default Emails
Default emails will be used in the Buy, Sell, and Cart Process elements when the element-specific emails are not set.
- Default To Email: This is the default email address that will be used. If either "To Email" or "To Email (2)" is set in the individual elements, neither of the Default To Emails here will be used.
- Default To Email (2): This is a second default email address that will be used. If either "To Email" or "To Email (2)" is set in the individual elements, neither of the Default To Emails here will be used.
- Default From Email: This is the default from email address that will be used. If the "From Email" is set in the individual elements, the Default From Email will not be used. An example of what to put here is orders@mywebstore.com.
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.
- ERP Name: the name of the ERP to which the connection is being made
- ERP Host: the host address of the ERP
- ERP User: the username used to logon to the ERP
- ERP Password: the password corresponding with the username to logon to the ERP
- ERP API Path: this is the path that CMSCart will use to look for the API. If it is not set, or not given the correct name, no API is included
- Default Price List: the price list that the ERP should use to retrieve prices
- Default Currency: the currency in which to retrieve the prices. i.e. USD (U.S. Dollars)
**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:
- Items Page and accompanying SalesListItems element that belongs on this page
- Search Page and accompanying SearchList element that belongs on this page
- any page that has the element SalesList. This is the list of sales categories that many times is displayed down the left side of a site
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.
- New Embedded Template: entering a name here and clicking Update will cause the cell to contain a new template with the name you specified. If you go back out the template design, you will see that
the cell will now contain the new template, and you can build that template in the same way as any other template.
- Existing Template: this dropdown is populated with all the templates in the current site. Any template in your site can be added to any cell, making for easy reuse of templates. Just select the
existing template you want to add and click Update.
WARNING: As aforementioned ANY template can be added to ANY cell which can result in a recursive reference to itself, causing a crash or lockup. So don't do it!
- New Content Area: if a new content area is entered and after clicking on Update of course, going back to the main template design area and looking at the template area where the content area was
added with show that content name. Clicking on that content name brings up the Content Producer. Notice that the Content Producer will automatically be filtered by the page and template you are on.
Notice as well that if the content being added is not intended to be specific to that particular page and instead is shared among many pages using that template then clicking on page filter and selecting
blank will do shared content.
- Existing Content Area: this dropdown is populated with all the content areas in the current site. Any content areas in your site can be added to any cell, making for easy reuse of content areas. Just select the
existing content area you want to add and click Update.