Skip to main content

Forms

YunoHost uses a lot of forms. You can found here information on supported types question and properties.

Questions

!!! Questions are called Options in the code.

Generic properties

PropertyScopeDescriptionExample
typeEverywhereSpecify the type of the question (see bellow for the list)type = "string"
askEverywhereThe title of the questionask.en = "Cats or dogs ?"
helpEverywhereAn help messagehelp.en = "Think carefully!"
optionalEverywhereSet true if the question is not mandatoryoptional = true
readonlyEverywhereAvoid user to be able to change the valuereadonly = true
exampleEverywhereGive an example to help to understand the format of the answerexample = "camille@example.com"
pattern.regexpEverywhereRegex to validate the new valuepattern.regexp = "^.+@.+$"
pattern.errorEverywhereError to display if the pattern doesn't match
redactEverywhereAvoid a confidential value to be loggedredact = true
defaultInstallA default value for the question
visibleConfigPanelA simple js expression based on other short keys questions to hide or display dynamically the questionvisible = "login && ! private_key"
bindAppConfigPanelSee App configuration panel docbind = "__INSTALL_DIR__/config.yml"
  • help, optional, readonly and visible are also available on panels and sections entities.
  • Long help messages could not to be correctly displayed for user using yunohost CLI
  • For the moment default properties are not supported in app config panel and you have to initialize the value by yourself in config file or settings.

display_text (readonly)

Display a simple text.

markdown (readonly)

Display a markdown (if you don't use markdown features, prefer display_text)

alert (readonly)

Display an alert box with different style.

PropertyDescriptionDefault
styleStyle of the alert box (success, info, warning, danger)info

button

Display a button with different style (useful for custom actions).

PropertyDescriptionDefault
styleStyle of the alert box (success, info, warning, danger)success
enabledEnable or disable the buttonTrue

string

Input text monoline.

text

Input text multilines

PropertyDescriptionDefault
redactStyle of the alert box (success, info, warning, danger)success

password

Password input. {} chars are forbidden and value is not added to logs.

color

Hexadecimal color starting with # with a color picker.

number

An integer.

PropertyDescriptionExample
minMinimal value
maxMaximum value
stepSteps between each next possible value

range

PropertyDescriptionExample
minMinimal value
maxMaximum value
stepSteps between each next possible value

boolean

PropertyDescriptionExample
yes
no

date

A date picker with date in the format YYYY-MM-DD

time

A time picker

email

An email input

path

url

By default it ask for a web URL but you can change the pattern if you want to.

file

File question

PropertyDescriptionExample
acceptSame format than HTML file input

! This file type is not made for big files transfer, it's just for small logo, or config files.

select

Dropdown

PropertyDescriptionExample
choiceslist or dictionary of choices

tags

Multi choices selection.

PropertyDescriptionExample
choicesList or dictionary of choices

domain

List all added domains

app

List all installed apps

user

List all users

group

List all groups