I must be missing something about the select field type

I have this in my blueprint…

fields:
title:
label: Title
type: title

category:
label: Item Category
type: select
options:
event: Recent Event
news: News Article
resource: Resource

I can’t figure out how to return the category value of the selected option, not the label of the selected option. I have read several posts, but still must be missing something. The simple echo statement returns the label of the select field, not the value. Why?

<?php echo html($subpage->category() ) ?>

What am I missing? I would like to return the value, ie, Recent News, rather than the label, news.

See this post: Display Blueprint Labels on Front End

I think I may not be asking this question very clearly. I had seen this post. I am not wanting to output the label of the field itself. I guess at the root of this I don’t understand expressing the selection options as a “key:value” pair. My initial thought was the key (to the left of the :) would be a machine friendly id for the unique option allowing the value (to the right of the :) to be a people friendly expression of the selection. My problem goes away if I set the selections to be something like:

  options:
     News Article: News Article
     Recent Event: Recent Event
     Resource: Resource

This however, seems redundant and I guess I assumed a function for both aspects of the key:value pairing… Again, I am probably not understanding something simple here.

The post I pointed you to was all about the “labels” of select or checkboxes fields, see also this post.

But you can also do it like you suggested above.

The label (or rather value) map option gives you more control over the output, like if you want to change what is shown in the frontend, you simply have to modify the map, not the blueprint and the content files. Also, in a multilang environment, you would likely want to translate these labels/values in your language variables.