A docly schema example (schema and template) Last updated: 26. Jan 2023

Create your own "Docly Forms" to gather and publish information online in Docly.

Form code

Create the form the user will input data into. You create it with HTML tags and optional smartform tags. It uses bootstrap css.

<div class="form-group">
    <label>Field 1</label>
    <input name="Field1" />    
</div>
<div class="form-group">
    <label>Field 2</label>
    <input name="Field2" type="date" />    
</div>

Screenshot after inserting this markup in a "Docly Form" document. And creating a test document:

Image collection

See more examples and documentation on creating smartforms at:
http://smartform.ikx.no

Display template

Here you can create one or many ouput templates for displaying this document. If you want to create a table or list of many documents in a folder, see the next chapter.

  • Template ID - An ID and extension for your code. Example: "Publish.html"
  • Friendly Name - The name users will be presented with when publishing or download this template.
  • Output name - Optional
  • Options
    • Bound to specific version - Changes to the template will not affect already created documents (not working yet)
    • The output is available for download - Check this option if you are creating a template for downloads. A good practice is to include all the resources in the file. Embedding css, html and images to make it an offline document.
    • Allow publish to web - Check this option if you are making a template for publishing this document.
    • Generate JS from HTML template - Will generate embedable JS code that "injects" the document into another page.
    • Static content. Allow cache - Check this options if the document produces a static cachable content.
    • Remove empty lines in output - Check this option to optimize the output source for this template (removes empty lines)
<html>
    <head>
        <title>#Filename#</title>
    </head>
    <body>
        <h3>This displays content from the file.</h3>
        Value 1: #Field1#<br/>
        Value 2: #Field2#
    </body>
</html>

See example setup below.

Image collection

The first template that allows publish to web, will be the default template in a published folder for the files.

See an example publish of the test document mentioned in chapter 1:

Image collection

Se the JavaScript reference and examples for more information.
https://developers.docly.net/JavaScript-examples/

Integrate in published folder

If desired you can present your data in a published folder through a hash template file. Publish any folder and select "No template".

Click new and create a new code file called "index.hash" in a folder.

<html>
    <head>
        <title>Test file</title>
    </head>
    <body>
        <div data-loop="getfiles('Myfolder')">
            Value 1: #Field1#<br/>
            Value 2: #Field2#
        </div>
    </body>
</html>

Example setup:

Now create a folder called "MyFolder" and place a few "Test documents" in it.

Open the published folder and the contents

Se more code examples:
https://developers.docly.net/JavaScript-examples/