A docly schema example (schema and template)
Create your own "Docly Schemas" 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> Screenshots after inserting this markup in a "Docly Schema" document and creating a test document:
Image collection
See more examples and documentation on creating smartforms at smartform.ikx.no.
Display template
Here you can create one or many output 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
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 — embed 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 - Stored with the template, but currently has no effect on caching.
Remove empty lines in output - Removes empty lines from CSS, JS and TXT templates (on by default). HTML templates are not affected — use HTML minification for those.
Modern syntax (HashJS compatibility mode off) - Compiles this template as plain JavaScript, without the older template syntax: no bracket conditions, no text operators such as ^= and ~=, and function names must match exactly. Recommended for every new template (see Start new sites in strict JavaScript mode). Leave it unticked for existing templates until they are converted (see Template operators differ from JavaScript in compatibility mode).
<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
See the JavaScript reference and the examples for more information.
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 to see the contents.
See more code examples.