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:
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
<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.
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:
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>
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/