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 →

Overwrite site.yaml

Started by finrik 9 years ago · 4 replies · 1309 views
9 years ago

Hello

I create a file named site.yaml inside user/themes/mytheme/blueprints/ with this code:

TXT
@extends:
'@parent'

form:
fields:
content:

YAML
        fields:
            myfield:
                type: text
                label: My Field

This is the sample code of the documentation:
https://learn.getgrav.org/forms/blueprints/example-config-blueprints

But the field "My Field" is not displayed under "Config"->"Site".

What am I doing wrong?

Thank you for your help!

9 years ago

Hi @finrik, I use this technique in my Open Course Hub skeleton, perhaps another example might help you?

https://github.com/hibbitts-design/grav-skeleton-course-hub/blob/master/blueprints/config/site.yaml

I also tested the example given of:
@extends:
'@parent'

YAML
form:
    fields:
        content:

            fields:
                myfield:
                    type: text
                    label: My Field

And it seems to work for me:
2018-02-05_10-06-15|613x500

Please let me know if you can get things going.

last edited 02/05/18 by Paul Hibbitts
9 years ago

Thank you for your answer! But it didn't work.

This file:
/user/themes/mytheme/blueprints/config/site.yaml

@extends:
'@parent'

form:
fields:
content:

YAML
        fields:
            myfield:
                type: text
                label: My Field

However, the field is not displayed. It looks like that the file is not read from Grav Admin?

9 years ago

Thanks a lot, it worked.

Of course, it would be really nice if it could be configured via themes. Maybe in the future. :)

👍 1

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Anna, 2 days ago
3 67 4 hours ago
Forms & Blueprints · by TomW, 1 month ago
3 343 1 month ago
Forms & Blueprints · by Japhy, 2 months ago
2 565 1 month ago
Forms & Blueprints · by FrViPofm, 2 months ago
5 581 2 months ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2566 9 months ago