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.

General

How to correctly override taxonomy category field in admin?

Started by Alexander Kim 8 years ago · 2 replies · 580 views
8 years ago

Created blueprint under: "themes/MYTHEME/blueprints/single-news.yaml"

YAML
title: News
'@extends':
    type: default
    context: blueprints://pages

form:
  fields:
    tabs:
      type: tabs
      active: 1

      fields:

        options:
          type: tab

          fields:

            taxonomies:

              fields:

                header.taxonomy.category:
                  validate:
                    required: true

It doesn't work. I also checked admin plugin repo source codes and couldn't find anything regards on how the fields are named in yaml, in order to override/extend them.

8 years ago

you can check for original blueprints in system/src/blueprints

8 years ago

@paul:
you can check for original blueprints in system/src/blueprints

Ok, found it:

YAML
            taxonomies:
              type: section
              title: PLUGIN_ADMIN.TAXONOMIES
              underline: true

              fields:
                header.taxonomy:
                  type: taxonomy
                  label: PLUGIN_ADMIN.TAXONOMY
                  multiple: true
                  validate:
                    type: array

What's the correct way to override in my blueprint? Just copy everything and add my validation?

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 9 hours ago
General · by pamtbaau, 14 hours ago
1 51 14 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago