You should be able to just use macros in your html for the template and do checks such as this:
{% MyValue == "optiona" ? " write optiona" : "optionb" %}
Note:You may want to set the string value to lower as well just for reliability!
Depending on how many options you have, you could also do an if statement with multiple else clauses and then have your html or output in the else clause.