To turn on the TEACUP feature, all you need to do is to define the scheme file "teacup" (scheme%teacup&) with Attribute:var=description lines. Here is an example:
Attribute:Code=Product code Attribute:Price=Unit price Attribute:Category=Category Attribute:ShortName=Short name Attribute:LongName=Long name Attribute:Remark=Remark
The description of the attributes are dummy for now. All the code looks at is the element name (the one after Attribute:).
Owner can enter property values in the TEA of PageBody as {var=value}. For example, "Look at this {ShortName=Digital Camera}! Only ${Price=100}! <!-- {Code=DGCAM321} -->"
The owner entered values will be put into the variable session%teacup. Any applications that process those values should get it from session%teacup:var. In the above example, session%teacup:ShortName will contain "Digital Camera", session%teacup:Price "100" and session%teacup:Code "DGCAM321".
The owner may choose NOT to enter any Properties in a particular page. If so (i.e. no attribute values are found), the session%teacup variable will be preserved. Otherwise, session%teacup will be set to the owner entered values.
If you want to disable TEACUP for a particular page (e.g. the curly brackets of JavaScript constructs in the TEA of that page may be misinterpreted as BEE variables), you can define TEACUP=Disabled in the text file (via variable text%page&TEACUP).
|