Content Types

By default, Vapid assumes that all template tags are text, and will generate text field inputs in the dashboard. You can easily change the type of dashboard input by specifying one of the types below.

{{intro type=html}}

Additionally, template tags accept any number of parameters, which can tell Vapid how to render the content, or how to further configure the dashboard input. Each content type below has a corresponding table which describes its parameters.

{{intro type=html editor=markdown required=false}}

All content types have the following parameters unless specified differently below.

Parameter name Default value Possible values Description
help any text Adds helper text below the dashboard input field.
label any text Changes the dashboard form label.
default any text Set a default value.
placeholder any text Adds placeholders text to the dashboard input field.
required true true | false All dashboard input fields are required by default.
priority any number By default, the dashboard renders fields in the order they appear in the HTML. By specifying the `priority` option, you can change their order to your liking.

Text

Plain text.

Parameter name Default value Possible values Description
long false true | false Renders a textarea input, for longer entries.
maxlength any number The maximum number of characters that the input field will accept.

HTML

HTML content, entered through a WYSIWYG editor, Markdown, or raw.

Parameter name Default value Possible values Description
editor wysiwyg wysiwyg | markdown | false Depending on the option, it will render a different HTML editor.
images false true | false Allow the user to upload/embed images into content. Note: this only works with the WYSIWYG editor.

Choice

Presents the user with a choice, from zero to multiple options. This would typically be used if you were asking for Yes/No answer, to choose one from many options, or in some case multiple-choice.

The choice directive tries its best to determine what type of input (checkbox, radio, dropdown, etc) would suit the options best. You can often override its logic, as long as it makes sense to do so.

Parameter name Default value Possible values Description
options a comma-separated string The choices you'd like to present to the user. Can be left blank if yes/no.
input checkbox | toggle | radio | dropdown The type of input used to present the options.
multiple false For multiple-choice questions. Always renders a dropdown menu. Must have at least two options.

Date

Date or DateTime input.

Parameter name Default value Possible values Description
format %B %e, %Y anything supported by strftime. Formats the date.
time false true | false Presents the user with a datetime prompt. By default, the date directive only asks for a date.

Image

The ability to upload images.

Parameter name Default value Possible values Description
width any integer Resizes the image width, and adds a width attribute to the image.
height any integer Resizes the image height, and adds a height attribute to the image.
alt any string Adds an alt attribute to the image.
class any string Adds a class attribute to the image.
tag true true | false Renders an img tag, or the src URL.

URLs and/or the ability to render embeds (e.g. YouTube videos).

Parameter name Default value Possible values Description
unfurl false true | false If true, it will attempt to render the oEmbed representation. e.g. It will render a YouTube video for a YouTube link.

Number

Number inputs.

Parameter name Default value Possible values Description
min any decimal or integer The minimum value that the input will accept.
max any decimal or integer The maximum value that the input will accept.
step any decimal or integer The number increased or descreased when the UI (arrows or slider) is changed.
range false If true, renders a type="range" input. If false, type="number".