Skip to content

{{ select_var:label }} is not working #2066

@twd3

Description

@twd3

To get the labels of the select field you do {{ select_var:label }}. This is not outputting anything. I can get the default of value working with {{ select_var }}.

Make a select with key and label options. Try to use in template like email or on a form submission tag with {{ select_var }}, it works, now try and do with {{ select_var:label }}, it outputs nothing.

Side note: I tried this as well: {{ select_var }}{{ label }}{{ /select_var }}

On docs there is a typo too. https://statamic.dev/fieldtypes/select#templating

<p id="{{ select }}"> Oh yeah? {{ select:value }}</p> <<< This is the same thing...I think you want this:
<p id="{{ select }}"> Oh yeah? {{ select:label }}</p>

Statamic version: 3.0.0.-beta-37

PHP version: 7.3

Install method:

  • Fresh install from statamic/statamic

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions