title: How can I check the value of a dropdown menu in craft cms / twig?
body: <p>I have a dropdown menu with 2 options</p>
  
  <ul>
  <li>Ordered</li>
  <li>Unordered</li>
  </ul>
  
  <p>I want to check if the value is Unordered or Ordered</p>
  
  <pre><code>  {% set viewModel = {
       cards: content['cards'] ?? [],
       cardListType: content.cardListType ?? ''
     } %}
  
  
     {{ viewModel.cardListType|json_encode() }}
  </code></pre>
  
  <p>Returns this to me 
  <code>{"0":{"label":"Unordered","value":"unordered","selected":true}}</code></p>
  
  <p>I want to check if the value of <code>viewModel.cardListType</code> is unordered and that it's selected.</p>
  
  <p>I have tried</p>
  
  <pre><code>   {% if viewModel.cardListType.value is unordered %}
           &lt;p&gt;UNORDERED&lt;/p&gt;
     {% endif %}
  </code></pre>
  
  <p>and</p>
  
  <pre><code>  {% if viewModel.cardListType.value:unordered %}
           &lt;p&gt;UNORDERED&lt;/p&gt;
     {% endif %}
  </code></pre>
  
  <p>and several other variations of this.
  I don't understand the documentation/ syntax for dropdowns in craft or twig.
  Can someone please explain like I'm 5 how this works and how to check the value?
  I am using Craft 3 if this changes the syntax</p>
  
  <p>Thanks in advance</p>