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

Using multiple import@ in yaml how to order the forms

form theme

Started by Max 3 years ago · 0 replies · 421 views
3 years ago

Hey all,

after figuring that the yaml-parser is quiet sensitive to the identation formatting, I found something that I'd like to ask regarding theme blueprints:

If I use multiple import@ statements (like mentioned here in the docs), the resulting forms are displayed in reversed order.

Here my example of my blueprint file:

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

form:
  fields:
    tabs:
      type: tabs
      active: 1

      fields:
        options:
            import@1:
              type: partials/gallery-bits
              context: theme://blueprints

        filminfo:
          type: tab
          title: FilmInfos

          fields:  
              Awards:
                type: section
                title: Anzeige Optionen
                underline: true

              header.showaward:
                type: toggle
                label: Festivals und Awards anzeigen
                default: 1
                options:
                  1: anzeigen
                  0: ausgeblendet
                validate:   
                  type: bool

          import@3:
            type: partials/awards-bits
            context: theme://blueprints

          import@2:
            type: partials/film-bits
            context: theme://blueprints

I observe that the "film-bits" blueprint from import@2 is shown first in the admin panel although it is used last in the yaml-file. Well, this may be worked around (although confusing) by reversing the imports in the yaml file. But more over and very inconvenient is that the 'Awards' section is displayed last in the admin panel, regardless where I put it with respect to the import@2 and import@3 statements.

see screenshot for example:
Capture|637x500, 75%

Does anyone have an idea how to control the appearance of the import@ fields in the admin panel?

Thanks for any help.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1139 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 63 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 137 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 112 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 131 7 months ago