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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Content & Markdown

Filtering a lot of pages with Taxonomy

Started by Samis G 7 years ago · 0 replies · 542 views
7 years ago

Hi there,

I have a situation where I need to select "pages" by some properties. I've created a Taxonomy for them, Field, Municipality, Organizator, Accredited. And everything seems to work, but...

There are over 800 hundred items in the folder and Grav takes quite a while to respond sometimes. How would I improve this?

Is there a way to return the collection by pages? I've tried using limit, but it seems Grav only looks in the amount of pages, but doesnt return them.

My "query" example: {% set items = page.collection({'items':{'@taxonomy':{'Sritis': type, 'Savivaldybė': municipality}},'order': {'by': 'title', 'dir': 'asc'}}) %}

And with a limit, but working not the way I want: {% set options = { items: '@self.children', 'limit': 25, 'order': {'by': 'title', 'dir': 'asc'}, 'pagination': true } %} {% set items = page.collection(options) %}

Thanks in advance.

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 100 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 187 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 148 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 63 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 259 1 year ago