Template: How to get value from select

If the select options looks like that

1: Label
2: Label2
3: Label3

I get “Label” with


But how to get the 1 before the Label?


Short: In this case you can’t get them.


Normally, your keys are stored in the content file, not the labels. So $page->select_name() would automatically return the desired value. The problem here are the numeric keys. To use them, you have to set your options in the long form:

    label: Category
    type: select
      - value: '1'
        text: Label 1
      - value: '2'
        text: Label 2