estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...

Home Page:https://frontmatter.codes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement: filter by record type (not content folder) in Dashboard Content View

pauko opened this issue · comments

Is your feature request related to a problem? Please describe.
As you introduced support for sub-content on behalf of #722 and #715, I organize my (single) content folder as illustrated in the diagram in #715.

contents/
├─ Solution A/
│ ├── index.md
│ ├── problem-1-of-A.md
│ ├── problem-2-of-A.md
│ ├── goal-1-of-A.md
├─ Solution B/
│ ├── index.md
│ ├── problem-1-of-B.md
...

At the moment I can't filter for a specific record type in the Content View of the Dashboard, e.g., in above example, I can't filter all problem records across all sub-content directories.

Describe the solution you'd like

  1. The Content View of the Dashboard should allow to filter by the type metadata field of each record.

  2. In combination with #744, cascades of filters should be supported, for instance, I can filter by some custom taxonomy and then show specific record types of some value of the custom taxonomy. In above example this means, I can filter all problem records (by type) of Solution A (by custom taxonomy).

Describe alternatives you've considered
As I don't associate each record type with a dedicated content folder, the existing filtering by content folders is too coarse for this use case.

Additional context
Already mentioned in above sections.

Thanks, @pauko, for the suggestion. An implementation where you can define your filter options is coming.

There will be a new setting introduced:

{
  "frontMatter.content.filters": [
	"pageFolders", 
	"tags", 
	"categories",
    {
      "title": "Type",
      "name": "type"
    },
	"otherValue"
  ]
}

As you can see in the above code, you can define your filters as a string or provide a title/name.

Feel free to give it a try in the beta and provide feedback if needed.