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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Forms & Blueprints

Extend default blueprint issues

Solved by Karmalakas View solution

Started by grund 5 years ago · 4 replies · 820 views
5 years ago

The extend default blueprint does not seem to work anymore. Sometime after the update to 1.7 the additional fields i added do not show up anymore not sure if related though.

File is properly called project.yaml has no tabs, only spaces, the taxonomy category does work on the 'Options' Tab but 'header.video' is not showing at all. It did work before. Any ideas?

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

form:
  fields:
    tabs:
      type: tabs
      active: 1
      fields:
        content:
          type: tab
          fields:

            header.taxonomy.category:
              type: select
              ordering@: header.title
              label: Project Category
              highlight: 0
              data-options@: '\Grav\Theme\Zitron::categories'

            header.video:
              type: text
              style: horizontal
              label: Video URL
5 years ago Solution

Since 1.7 I believe it should be either "@extends" (in quotes) or extends@ (@ at the end like you have ordering@). Otherwise it's an invalid YAML

5 years ago

@grund, Always a good idea to read the upgrade documents. Grav 1.7 does have quite some changes of which some are breaking.

IMPORTANT: Grav 1.7 YAML parser is more strict and your site may break if you have syntax errors in your configuration files or page headers.

When you run $ bin/grav yamllinter -a you will get the following error thrown on your blueprint:

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

NB. In your defence... Minor version changes should not introduce breaking changes. Grav 1.7 should therefor have been called 2.0 IMHO.

last edited 04/20/21 by pamtbaau
5 years ago

thanks! the linter is a nice tool to have. i'm in and out of development of a theme and not that experienced so i might sometimes skip things like "advanced" haha. the need to quote the scalar is not consistently changed in the docs too it seems.

5 years ago

@grund, There is nothing keeping you from fixing 1.6 leftover syntax in the docs by creating a pull request... Open Source is a two-way street...

👍 2

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1136 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 135 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 129 7 months ago