I know I probably reached my limit today for asking questions, but from my TWIG I can use the findTaxonomy function quite nicely but only when it is hardcoded. I am trying to make the TWIG flexible in that I can set YAML header options to make it display different content
Trying to do something like
{% for feature in taxonomy.findTaxonomy({'{{ page.header.taxfeatures.type }}': '{{ page.header.taxfeatures.filter }}'}) %}
{% set tax_type = page.header.taxfeatures.type %}
{% set tax_filter = page.header.taxfeatures.filter %}
{% for feature in taxonomy.findTaxonomy({'dna' : tax_filter}) %}
so it seems like it does not like the hask ‘key’ to be a variable.
@Robert Yes, Twig does not like a hash key to be a variable. But you can protect the variable, meaning it will be evaluated first, then set as a hash by using parentheses around:
{% for feature in taxonomy.findTaxonomy({(page.header.taxfeatures.type): page.header.taxfeatures.filter}) %}
---