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

Override Taxonomy Type Fields

Started by Muut Archive 10 years ago · 2 replies · 376 views
10 years ago

I have a blueprint I am working on that utilizes the Taxonomy type and am looking to override one of the fields so I can display it in a different manner than the default 'select'-ize type.

The blueprint resembles similar to below:

YAML
header.taxonomy:
  type: taxonomy
  label: Taxonomy
  multiple: true
  validate:
    type: array

header.taxonomy.category:
    type: toggle
    label: Category
    highlight: 1
    options:
        1: YES
        0: NO
    validate:
        type: bool

This usually results in an error however. I have tried tweaking the source to skip the creation of the overridden items, but then I face an issue where the items in the .yaml file are being created as a comma separated string and not a list like it should.

10 years ago

I am also interested in this. Have you solved it somehow?

The problem i have is actualy just showing only one taxonomy type when using type:taxonomy instead of showing all of them.

10 years ago

You would need to use this new replace command in order to properly replace an existing blueprint field.

However, you might need to remove the field first, because that field is for header.taxonomy and you want to explicitly set a specific type of taxonomy.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1362 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1124 9 years ago