How can I act on a taxonomy term in my twig template? I'm trying to use two taxonomy items to build a button on my template. The logic is:

If this node is exactly equal to taxonomyTermFromVocabularyA
Print a button on the page with a URL built out of taxonomyTermFromVocabularyB


I thought I was doing well when a simple test proved that my terms were available. In the template, I tested by adding:

&lt;h3&gt;{{ content.field_taxonomy_resource_type }}&lt;/h3&gt;
&lt;h3&gt;{{ content.field_taxonomy_topic }}&lt;/h3&gt;


And out came the expected values on the page:


  Topic Page
  
  Oral Health


However, once I tried to actually use the terms I captured it never worked. The first part of the logic, where the button will eventually be built, I wrote as:

{% if content.field_taxonomy_resource_type == "Topic Page" %}
  &lt;p&gt; hello, it's working! &lt;/p&gt;
{% endif %}


produces no content at all. I expected to see my test paragraph sentence "hello, it's working!" appear on the page.

My best google-foo hasn't helped me at all and, alas, my soul is being crushed. I fear it's something completely obvious that I am just ignorant about.

Can anyone point me to the error of my ways? Why doesn't my twig if statement work?

@clive was absolutely right in the suggestion below that I was naming the array and not the particular item I needed when constructing my if statement. His correction to my code:

{% if node.field_taxonomy_resource_type.entity.label == "Topic Page" %}


is not working though, and the best I can tell is that the variable is unavailable to me. When I dump the variable using {{ dump(node.field_taxonomy_resource_type.entity) }}, I just get NULL. 

Clive's answer worked as soon as I changed out node to paragraph. Thanks!

{% if paragraph.field_taxonomy_resource_type.entity.label == "Topic Page" %}
content.field_taxonomy_resource_type is a render array, which you're comparing against a string. Instead, you need to get access to the label, and extract the term name.

Try this instead (if in a node template):

{% if node.field_taxonomy_resource_type.entity.label == "Topic Page" %}


Or, as we know it's a paragraph template:

{% if paragraph.field_taxonomy_resource_type.entity.label == "Topic Page" %}