Skip to content

Kirby 5.0.4

List

A simple WYSIWYG editor field for ordered and unordered lists

Example

fields:
  list:
    label: List
    type: list

Field properties

Name Type Default Description
$after mixed null Optional text that will be shown after the input
$autofocus bool null Sets the focus on this field when the form loads. Only the first field with this label gets
$before mixed null Optional text that will be shown before the input
$default mixed null Default value for the field, which will be used when a page/file/user is created
$disabled bool null If true, the field is no longer editable and will not be saved
$help mixed null Optional help text below the field
$icon string null Optional icon that will be shown at the end of the field
$label mixed null The field label can be set as string or associative array with translations
$marks mixed true Sets the allowed HTML formats. Available formats: bold, italic, underline, strike, code, link. Activate them all by passing true. Deactivate them all by passing false
$nodes mixed null Sets the allowed nodes. Available nodes: bulletList, orderedList
$placeholder mixed null Optional placeholder value that will be shown when the field is empty
$required bool null If true, the field has to be filled in correctly to be saved.
$translate bool true If false, the field will be disabled in non-default languages and cannot be translated. This is only relevant in multi-language setups.
$when mixed null Conditions when the field will be shown (since 3.1.0)
$width string '1/1' The width of the field in the field grid, e.g. 1/1, 1/2, 1/3, 1/4, 2/3, 3/4

Choosing available marks

The list field supports the following marks by default:

  • bold
  • italic
  • underline
  • strike
  • code
  • link
  • email
fields:
  list:
    type: list
    marks:
        - bold
        - italic
        - strike

How to use in templates/snippets

The content of the list field is stored as plain HTML. To render the field in your template, echo the value.

<?= $page->list() ?>