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

Filtering content

Started by Muut Archive 11 years ago · 5 replies · 965 views
11 years ago

Warning another newbie question, but it is not clear to me who handles this (grav, php, twig, theme, etc). If I take the Blog example in the Antimatter Theme, when I click on a Tag for a blog item listing, it changes the url:

TXT
blog/tag:journal

and now I only get a listing of blogs that have that tag in it's yaml file.

Where is this code that ignores the MD files in the pages/blog folder that do not meet that criteria? I want to mimic that same behavior for other content types (documents, samples, guides, tutorials, videos) and am trying to figure out my best file/folder structure.

11 years ago

Is is possible to disable this auto-magic filtering of collections? I have a project where I use collections extensively but not every collection display should be modifiable externally via a simple URL parameter.

I even wasn't aware of the auto-filtering until I looked at the source code of the collection() function.

Basically every non-modular collection in a Grav site can be filtered via the URL.
Could we have something like:

YAML
content:
  items:
    @self.children
    allow_taxonomy_filter: false

and also a site setting in system.yaml to default this filter off:

YAML
pages:
    allow_taxonomy_filter: false

I am happy to submit a PR for that.

11 years ago

It's a good idea to have this functionality. I'll add it. Thanks.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1345 9 years ago
Archive · by Muut Archive, 9 years ago
2 932 9 years ago
Archive · by Muut Archive, 9 years ago
2 4059 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago