Basically the whole "concept" comes down to the following
- We already have our tables defined in the application YAML file
- A report is just how to display the data
- Smarty Gives us a way to have some logic (Looping, Alternating Row Color)
- WE just need a filter for the data to display (WHERE CLAUSE)
The definition of page looks like this:
options:
title: Reviews
section review:
onerow: "Y"
table reviews:
column name_book:
compare: = @book
column review:
column ts_ins:
column ts_upd:
column uid_ins:
column uid_upd:
uifilter book:
description: Book Title
type_id: vchar
colprec: 50
template: p_review.tpl
options: Allows us to set things such as page title.
section: Allows us to litterally pull as much data as we want and place it in different sections around the page, such as maybe client information in one area and then ads pertaining to this clients industry in another area.
onerow: Specified that we only expect one row back for this page(This is done so that we do not need a foreach loop in the smarty template)
table: Refer to tables that are specified in the application YAML file. Multiple tables can be specified and Andromeda will attempt to join the tables based on primary_keys
column: The columns to be used for display from the tables.
uifilter: Tells Andromeda that we need to filter on something, and if its not specified display a page so the user can enter it.
template: Tells Andromeda that this is a Smarty Page and to use the specified template.
Each section get assigned to a Smarty variable with the same name, then you just have to create the Smarty template.
An example of a Smarty template is this:
There as still a couple of minor bugs which should be fixed shortly and then there will be a release.{* Smarty *}
<table border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><h3>{$review.name_book}</h3></td>
</tr>
<tr>
<td>Review:</td>
</tr>
<tr>
<td>{$review.review}</td>
</tr>
<tr>
<td>Reviewed by: {$review.uid_ins} on {$review.ts_ins}</td>
</tr>
</tbody>
</table>