Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Archive plugin & taxonomy filter

Started by kitzunegari 8 years ago · 0 replies · 986 views
8 years ago

Hello,
for anyone wants to display Archive of posts and is struggling looking for a filter with multple or different categories, I'm going to show you a possible workaround:
 

    1. Set a custom field in \system\blueprints\pages\default.yml

      for eg.

      YAML
                  header.taxonomy.CUSTOM:
                    type: selectize
                    label: Custom
                    classes: fancy
                    default: Custom
                    validate:
                        type: commalist
      

       

    1. Add custom field to taxonomies list in \system\config\site.yaml
      taxonomies: [category,tag,CUSTOM]
       

 

    1. Change filter type in \user\plugins\archives\archives.yaml

      for eg.

      enabled: true
      built_in_css: true
      date_display_format: 'F Y'
      show_count: true
      limit: 12
      order:
      by: date
      dir: desc
      filter_combinator: and
      filters:
      CUSTOM: CUSTOM
      taxonomy_names:
      month: archives_month
      year: archives_year

Now the filtered list will be displayed in the sidebar:

list|303x254

last edited 01/27/19 by kitzunegari

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Anna, 2 days ago
2 53 16 hours ago
Forms & Blueprints · by Anna, 3 days ago
7 82 16 hours ago
Forms & Blueprints · by Anna, 1 week ago
5 186 6 days ago
Forms & Blueprints · by TomW, 1 month ago
3 379 1 month ago
Forms & Blueprints · by Japhy, 2 months ago
2 595 2 months ago