Since LegEasy do not have the excellent new Memo field that can take very large blobs of data, we also have invented a single file DQL format that can serve a DQL with code and body form a single file. This format can also be used to serve a DQL form one memo field or from one string parameter in the DEServer. The only difference from the standard body format is that the file has to start with .dql as the first line. The dql 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 .dql is a .end this .end will be removed before the body is extracted from the file.


for Address ;
list records
    Name ;
    Address1 ;
    Address2 ;
    PostAddress  ;
    PostCode ;
    EMail .
.template base.html
<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 from the single page dql file

If you use a .dql file without any body portion, the list records in the dql 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 dql code elements
getbodytree=1 Return the definition of the template as the server will see it. This is named a BodyTree.
getdefinition=1 Return the dql 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 dqls that return json, so to use them on a page with body make sure to add json=1 as well.