If you do not want to use a DQL to produce data output, you can use the single file/memo based page format for serving data from PRISM together with the html code. The file/body has to start with .data as the first line. The data definition in json format then follows and is read until the first line that starts with a new page parts (that is start with a dot (.) as first character on the line. It also support a .template command that tells what template to use from the template cache. If the first section command after the .data is a .end this .end will be removed before the body is extracted from the file.


      "type" : "record",
      "tablename" : "Order"
      "type" : "list",
      "tablename" : "OrderLine"
<h1>The list of all addresses</h1>
<table class="table">
    <td>[{Address1}] [{Address2}]</td>
    <td>[{PostAddress}] [{PostCode}]</td>

The rest of the file will then be added as the body template before it is compiled. If the compilation holds a ".template templatename" this will be fetched before the DQL is compiled, run and processed through the LivePage.If you are not using a .template, you must close the dql with a .end if you want to use preheader/items html. The example above do not need this as it uses .template.

Commands to control what is output

If you use a .data file without any body portion, the data will be returned as json. With a body, you get the generated html file. It you for some reason want to override this, you have a few query commands you can use.

json=1 Return json even if there is a body.
getcode=1 Return the data definition
getbodytree=1 Return the definition of the template as the server will see it. This is named a BodyTree.
getdefinition=1 Return the data field definition
jsonpretty=1 Return human readable json code.
astext=1 Return body as mime text/text instead of text/html

All but astext=1 only works on pages that return json, so to use them on a page with body make sure to add json=1 as well.