Skip to content
Grav 2.0 is officially stable. Read the announcement →

Muut Archive Legend

@Muut · Joined 9 years ago · 18337 posts · 3878 topics · 137 reputation

Badges

✏️ First Post 💬 Conversation Starter ❤️ Well Liked

Recent posts

  • findTaxonomy with variables · 11 years ago

    Oh yah @sommerregen is absolutely right. I didn't test my code! But parens are a simple way to restrict dot notation to a specific variable. Otherwise you need to use attribute() function: http://tw

  • findTaxonomy with variables · 11 years ago

    @Robert It is an undocumented feature. I found it, once I have had the same problem like you on StackOverflow. Don't know the URL anymore...

  • findTaxonomy with variables · 11 years ago

    @sommerregen That did the trick. Awesome! - would I find this in the TWIG documentation ? I could not see where this would be.

  • findTaxonomy with variables · 11 years ago

    @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 ta

  • findTaxonomy with variables · 11 years ago

    FWIW, I was able to get this to work: {% set tax_type = page.header.taxfeatures.type %} {% set tax_filter = page.header.taxfeatures.filter %} {% for feature in taxonomy.findTaxonomy({'dna' : tax_f

  • findTaxonomy with variables · 11 years ago

    I tried what you suggested {% for feature in taxonomy.findTaxonomy({page.header.taxfeatures.type: page.header.taxfeatures.filter}) %} but am getting a TWIG syntax error: A hash key must be followed b

  • findTaxonomy with variables · 11 years ago

    You can't nest tags, but nor do you need to: {% for feature in taxonomy.findTaxonomy({page.header.taxfeatures.type: page.header.taxfeatures.filter}) %}

  • findTaxonomy with variables · 11 years ago

    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

  • Filtering content · 11 years ago

    Fantastic, thanks for adding that.

  • Filtering content · 11 years ago

    https://github.com/getgrav/grav/commit/7c6471fe2a0aa3b452e57941378c6d7323b2866e Commited in Develop branch. will be enabled by default (so as not to break existing behavior, but you can either turn i