MODULES

Front-end Submit Modules

6min
when you install a module, a front end form file is automatically generated within your module, in a folder called form it automatically contains all fields from the module you can view this folder using code editor, it is next to the detail and list folders for your module syntax output your module form on a page {% include 'module form', id '1' %} toolbox has support for module input forms, and the following options will be given in the modal, or you can set them yourself enabled default is false boolean determines if items are auto enabled or not expiry date default is never expires timestamp when the new item will expire release date default is as soon as the form is submitted timestamp when the new item will be released upload dir string default is documents/form uploads/module 1/ where uploaded files will be stored must follow this format 'folder/optional folder/' standard fields some fields are required for the form to be able to set up the module items correctly these fields are for 'enabled', 'expiry date', 'release date', 'upload dir', and 'slug' they stay the same each form, and don't have a module specific id attached to them all forms should be wrapped in a liquid form tag {% form %}{% endform %} all forms need a submission button \<button onclick="s form submit v2(this,'module 1')">submit\</button> category field (optional) example 1 this example can be used for a module submit form that is displayed within a the layout of another webapp or module this category array\[0] finds the first category the current item is categorised to and can be changed to be a full array, or specific category id example 2 this example can be used on pages other than webapp and module layouts 123456 replace with the id of a category of your choice location field (optional) you can submit a location value for a module item as shown in the following example the value should be a stringified json object