Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

How to get a collection of pages that are descendants of page "/products" AND have a taxonomy: taxonomy.tag = top in twig?

Started by fosil 8 years ago · 2 replies · 932 views
8 years ago

Is it sort of a twig template? Similar to: page.collection({items: {'@taxonomy.top': '1', '@page.children': '/parent-page'}}) - but this does not work the way I need it

8 years ago

@fosil I'm afraid I do not really get the gist of the question. Would you mind editing your post/title and elaborate a bit more on:

  • what you are trying to achieve
  • what you expected to see
  • what you have tried
  • what the actual result was
last edited 09/18/18 by pamtbaau
8 years ago
  • I have page with route /products
  • it contains a tree of child pages
  • these pages have the taxonomy "TAG" with values: 'top', 'new', 'discount', ...
  • In page /products, I need to get a collection of pages that are part of a tree and at the same time they have TAG = 'top'

pseudocode:
collection = (@page.descendants == '/products') AND (taxonomy.tag == 'top')

Suggested topics

Topic Participants Replies Views Activity
General · by jeremycherfas, 1 week ago
5 185 11 minutes ago
General · by lynbor, 6 days ago
2 128 3 days ago
General · by Old Man Umby, 1 week ago
1 103 1 week ago
General · by Sebastian, 2 weeks ago
1 127 2 weeks ago
General · by Andy Miller, 3 weeks ago
0 251 3 weeks ago