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 →

Extending account.yaml

Solved by Vadim View solution

Started by Vadim 3 years ago · 1 replies · 857 views
3 years ago

Hello everyone!

Thank you for all your hard work. I searched through the forum and didn't find an answer to my question. I would like to add couple fields to each user file by extending system/bluerints/user/account.yaml.

I tried different options, but didn't come up with the solution. I would appreciate any help on this.

Thank you!

👍 1
3 years ago Solution

Ok, the best solution comes by itself after you asked for help. In case if someone will have the same issue, here's what worked for me:

Create a new yaml file with the following path:
user/blueprints/user/account.yaml

To extend the account form you can add smth like this:

YAML
title: Account
'@extends':
    type: account
    context: 'blueprints://user'

form:
    fields:
        custom_field1:
            type: number
            label: Custom Field 1
            validate:
                type: number
        custom_field2:
            type: number
            label: Custom Field 2
            validate:
                type: number
        custom_field3:
            type: number
            label: Custom Field 3
            validate:
                type: number
👍 2

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