FreedomSoft - "the future is freedom"
Attributes - Multiple Records

Freedombase easily outputs data from multiple records from the same table. Freedombase achieves this by maintaining a list of records that could be output and a pointer as to what record is currently being output, and moving the pointer to the next record when appropriate.

For single valued fields, Freedombase moves the pointer to the next record, whenever it is asked to output a field again and it has already output that field for the current record. This makes outputting data for multiple records as easy as simply repeating the Attribute tags.

For example, if the page contained the following tags:

%EXAMPLES_CUSTOMER_NAME%
%EXAMPLES_CUSTOMER_ADDRESS%
%EXAMPLES_CUSTOMER_NAME%

%EXAMPLES_CUSTOMER_ADDRESS%

The following would occur (please see the explanation in brackets):

%EXAMPLES_CUSTOMER_NAME% (NAME has not yet been output for the current CUSTOMER record, so output the value of the NAME field from the current CUSTOMER record.)
%EXAMPLES_CUSTOMER_ADDRESS% (ADDRESS has not yet been output for the current CUSTOMER record, so output the value of the ADDRESS field from the current CUSTOMER record.)
%EXAMPLES_CUSTOMER_NAME% (NAME has been output for the current CUSTOMER record, so move the pointer to the next CUSTOMER record, and output the value of the NAME field from that next CUSTOMER record.)
%EXAMPLES_CUSTOMER_ADDRESS% (ADDRESS has not yet been output for the current CUSTOMER record - remember, we are now pointing at the second record, not the first record - so output the value of the ADDRESS field from the current CUSTOMER record.)

Multi valued fields are handled in a similar manner, except that the pointer moves to the next multi value within the current record, instead of moving to the next record.

previousnext
12345678910111213141516171819

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