decaporg / decaporg/decap-cms

Search, sort, group by template tags in summary

Open
#5,724 5 comments 1 reaction 1 assignee Claimed by @VISHESH0932 View on GitHub
area: ux type: feature
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

It is great that we can add template tags to the summary of a collection entry, for instance `{{dirname}}` is useful on nested files. However, it is not possible to group, sort, or search by these.

A solution would support template tags in the config for `sortable_fields` and `view_groups` and return search results containing tags in the summary.

Proposed config:
```yml
collections:
- name: posts
label: Posts
label_singular: post
folder: content/posts
path: '{{slug}}/_index'
summary: "{{dirname}} - {{title}}"
sortable_fields: ['{{dirname}}', 'title', 'weight']
view_groups: [
{label: Category, field: category},
{label: Directory, field: '{{dirname}}'},
]
fields: [
{name: title, label: Title, widget: string},
{name: category, label: Category, widget: string},
{name: weight, label: Weight, widget: number},
]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.