FreedomSoft - "the future is freedom"
Expressions - Introduction

Another very useful, although less common, Freedombase tag, is the Expression tag. This takes the form of an opening Expression tag (%E%), followed by an expression, followed by the closing Expression tag (%/E%).

Freedombase Expressions are very similar to Freedombase Calculations; please see the Freedombase Calculation Help page for more details on Calculations. All commands and options are the same between Expressions and Calculations, except that Attribute and System_Class_Attribute work differently between the two.

Calculations are capable of looking up the database themselves, to find related records. Expressions cannot look up the database themselves. All data to be used within expressions must be set by the developer within the expression using the Template Attribute tag.

Expressions return a value to be inserted into the page at that point, much like a spreadsheet calculation returns a value into the spreadsheet at that point.

For example, to output different text onto a page depending on whether a customer owes money or not:

%E%(IF(%EXAMPLES_CUSTOMER_BALANCE%>0)THEN('They owe us money')ELSE('They do not owe us anything!'))%/E%

Another example, one used more frequently with Freedombase, is setting the 'selected' or 'checked' text within a select/drop down, or a checkbox or radio input field:

<option value="C" %E%(IF('%EXAMPLES_CUSTOMER_TYPE%'='C')THEN('selected'))%/E%>Corporate</Option>

Or:

<input type="radio" value="C" %E%(IF('%EXAMPLES_CUSTOMER_TYPE%'='C')THEN('checked'))%/E%> Corporate

previousnext
12345678910111213141516171819

    navigate     introduction     tags     attributes     expressions     include/insert     security     repeat/loop     command     creating     edit     update     custom code