Overwrite site.yaml


#1

Hello

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

@extends:
'@parent'

form:
fields:
content:

        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!


#2

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

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

form:
    fields:
        content:

            fields:
                myfield:
                    type: text
                    label: My Field

And it seems to work for me:

Please let me know if you can get things going.


#3

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

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

@extends:
@parent

form:
fields:
content:

        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?


#4

Actually, you need to put that file in your /user/blueprints/config folder (see https://learn.getgrav.org/forms/blueprints/example-config-blueprints) - please give that a go and let me know if that works for you.


#5

Thanks a lot, it worked.

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