 |

Table of Contents
License Agreement
Program Credits
|
 |
 |
 |

Software Manual
|
HTML Elements & The Site Layout
This software package is designed to make use of entities called elements to display content to your end users. Every item that is displayed to your end users and to you from within this administrator utility is generated by elements. Elements are nothing more than HTML code that is displayed by the program when certain criteria is met. For example, if an error message is to be displayed to a user, that message would be contained in an element to allow you to edit it. Another example is the printable invoice that is presented for orders from within the administrator utility. The invoice is made up of a main element for the main display and calls to other elements or subroutines for dynamic displays.
A Few Major Elements
Elements can be edited using the HTML Pages & Elements | Manage Site Elements function. Some of the more important elements include:
- Site HTML Layout - The Layout for your site
- Store Header - Tracking - Store header when tracking is enabled
- Store Header - No Tracking - Store header when tracking is disabled
Changes to the elements listed above will change the look and feel of your site.
Editing the HTML Site Layout
Editing the HTML Site Layout under the HTML Pages & Elements | Manage Site Elements function is straightforward. If you would like to use your own HTML in the site layout, do so. The only thing that you must make sure you keep is:
(CGIGET TYPE="SUB" VALUE="ste_exec_message")
(CGIGET TYPE="SUB" VALUE="ste_exec_element"
PARAMS="(CGIVAR)element_id(/CGIVAR)")
For display purposes in this manual, line2 is wrapped to lines 2 & 3. When inputting into your HTML, keep line 2 on one line. Keep this in the section of your HTML where you would like the store to show up. That's how the program knows were to put the store and any messages.
Working With Elements
With a little knowledge of HTML you can configure anything that is presented to your users by modifying and inserting elements. Elements work in a number of different ways:
Display Text To Users
In it's simplest form an element displays content to users. It can contain plain text or HTML.
Display A Variable From Within An Element
To display a pre-defined system variable from within an element you need to use a CGIVAR tag as follows:
This is (CGIVAR)html_site_name(/CGIVAR)
The code above will display the value associated with the variable 'html_site_name' to a user that views the page generated by that element.
Display An Element From Within An Element
To call one element from within another you will need to use a CGIGET tag with a TYPE of ELEMENT as follows:
(CGIGET TYPE="ELEMENT" VALUE="element_name")
This code embeds the content of the element 'element_name' inside the element that's being displayed.
Call A Script Subroutine From Within An Element
Script subroutines are accessible via elements and can be called with or without parameters. To access a subroutine you will need to use a CGIGET tag with a TYPE of SUB. The first example below calls the routine 'ste_cart' without parameters:
(CGIGET TYPE="SUB" VALUE="ste_cart")
The next example calls the same subroutine with one parameter, 'param1'. Parameters are passed in the CGIGET tag with the optional PARAMS attribute:
(CGIGET TYPE="SUB" VALUE="ste_cart" PARAMS="param1")
Lastly, the final example calls the same routine with multiple parameters 'param1' and 'param2'. Parameters are separated by pipe characters(|):
(CGIGET TYPE="SUB" VALUE="ste_cart" PARAMS="param1|param2")
Any number of parameters can be used. If parameters are used when calling a subroutine, via an element, if only one parameter is used, that parameter as passed as a scalar value (string). If multiple parameters are used, they are passed in array context (list).
Bringing It All Together
The way that the display scripting parses elements as they are presented to users allows us to embed CGIVAR tags within CGIGET tags. This allows you to call a subroutine with a known variable like the following:
(CGIGET TYPE="SUB" VALUE="ste_cart" PARAMS="(CGIVAR)fd_pg(/CGIVAR)")
Important Notes About Element Tags
There is logic in the display scripting that prevents you from doing any of the following things:
- Load a subroutine that does not exist.
- Load a subroutine that fails to execute (returns an error).
- Load a subroutine that does not display anything (ends with _proc).
- Load a subroutine that is common to all scripts (in the common directory).
- Load an admin subroutine from the web site (begins with adm_).
- Create an endless loop by loading elements or routines that load each other.
If you modify the code for an element and upon executing it you do not get your desired result try viewing the source for the resulting HTML page in your browser. Any errors will be printed in the source in HTML comments. If a variable is not displayed or passed to a subroutine correctly it must not exist globally. Failed variable displays are not reported in the HTML source because sometimes it is fully acceptable to display nothing for a missing variable.
|
 |