Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Page Blueprints doesn't load (doesn't show up in Admin)

Solved by pamtbaau View solution

Started by Mantas 6 years ago · 2 replies · 1118 views
6 years ago

I created new page via admin panel - Projects.
It created:
user/pages/0.3.projects/projects.md

I created new template in THEME/templates/projects.html.twig - this works.

Then I created blueprint in THEME/blueprints/projects.yaml with this code:

YAML
title: Projects
@extends: 
  type: default
  context: blueprints://pages 

form:
  validation: loose

  fields:

    tabs:
      type: tabs
      active: 1

      fields:
        content:
          type: tab
          title: PLUGIN_ADMIN.CONTENT

          fields:
            header.heading:
              type: text
              limit: 1
              label: Heading

          fields:
            header.text:
              type: textarea
              limit: 1
              label: Text

(i just copied it from other Grav project, where it works)

And It's just not showing up in admin. I tried it with several pages, tried cleaning Grav cache, and I just can't make it show itself.

6 years ago Solution

@Mantas, Run $ bin/grav yamllinter inside your site and your will see an error similar to the following:

/user/themes/quark/blueprints/project.yaml - The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 2 (near "@extends:").

Btw. Grav 1.7+ is more strict on yaml syntax. It's better to use extends@: instead. See the docs First Example

Then, after fixing that issue, run $ bin/grav yamllinter again and you will get something similar to:

/user/themes/quark/blueprints/project.yaml - Duplicate key "fields" detected at line 26 (near " label: Text").

👍 1
last edited 01/25/21 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by FrViPofm, 5 days ago
5 100 4 days ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2119 7 months ago
Forms & Blueprints · by Hugo Oliveira, 8 months ago
0 605 8 months ago
Forms & Blueprints · by Flachy Joe, 9 months ago
9 695 9 months ago
Forms & Blueprints · by Augustus, 10 months ago
7 741 10 months ago