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.

Archive

Trying to modify fields of default page blueprint

Started by Muut Archive 9 years ago · 9 replies · 1211 views
9 years ago

Grav ver.1.2.4
Thats one of my latest failed attemps.
Nothing changes in the book-page creation form .

YAML

title: Book

'@extends':
   type: default
   context: blueprints://pages

form:
  validation:loose
  fields:

    tabs:           # that field is a tabs collection
      type: tabs
      active: 1

      fields:           # each of its field is tab type.
        content:
          type: tab
          title: aha 
          fields:
            header.title
               type: text
               label: OOOOFOFOFOFOF 
---
9 years ago

Almost there! Just add : after header.title:

YAML
title: Book

'@extends':
   type: default
   context: blueprints://pages

form:
  fields:
    tabs:           # that field is a tabs collection
      type: tabs
      active: 1

      fields:           # each of its field is tab type.
        content:
          type: tab
          title: aha
          fields: 
            header.title:
               type: text
               label: OOOOFOFOFOFOF
9 years ago

No progress ..
I eved bin/grav clearcache before to open the new form but nothing

9 years ago

I put similar content into my THEME/blueprints/podcast.yaml, with the exception of
context: blueprints://podcast
and it worked for me.

9 years ago

I wish there was a faster way to learn that.
One drawback to yaml blueprints it how sensitive they are to tabs accidentaly inserted. Sth that my emacs do after hitting return to change line.

9 years ago

I found one mistake.
Although in my pasted example i had:
active: 1
infact (strangely) i really had:
active:1

and it seems that yaml dont like the closeness :-)

9 years ago

I did another test.
And it seems that yaml in grav wont accept
key:value without spaces after ':" .

9 years ago

ok. finally it worked.
Thanks for the feedback.
I wish the manual gets more informative on yaml 'sensitivities' :-)

9 years ago

Feel free to provide some examples in the cookbook via a pull request in the docs. That way more users will have some examples of achieving complex blueprints.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1277 9 years ago
Archive · by Muut Archive, 9 years ago
2 885 9 years ago
Archive · by Muut Archive, 9 years ago
2 4014 9 years ago
Archive · by Muut Archive, 9 years ago
1 2891 9 years ago
Archive · by Muut Archive, 9 years ago
3 1074 9 years ago