Move whole section of a blueprint to another tab?

Does anybody know whether there is an easy way to move a whole section in an Admin page blueprint? For example if I want the taxonomies section in the options tab to move to the content tab.

I tried ordering@ as it says in the docs but that seems to work only within the same tab. I reckon I need to unset@ the whole section under the original tab and then redeclare it where I want it – but can anyone confirm? Or maybe there is a simpler way?

Hi @Netzhexe,

if you ment a page blueprint which is available via the admin plugin, then you can do something like this:

Create a default.yaml inside of the theme’s blueprint folder and extend it using the extend@ directive as usal. Then copy the taxonomy section from the default blueprint <grav_root>/system/blueprints/pages/default.yaml. Use unset@ to disable it on the other tab.

Just for testing purposes, I copied the taxonomy to a modular-type yaml file and it works. Should work in a normal (default) page blueprint too.

title: Article
extends@:
    type: modular
    context: blueprints://pages

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

      fields:
        content:
          fields:
            content:
              unset@: true
            header.title:
              unset@: true
            header.media_order:
              unset@: true
                        
            taxonomies:
              type: section
              title: PLUGIN_ADMIN.TAXONOMIES
              underline: true

              fields:
                header.taxonomy:
                  type: taxonomy
                  label: PLUGIN_ADMIN.TAXONOMY
                  multiple: true
                  validate:
                    type: array
            
            header.menuTitle:
              ordering@: -99
              type: text
              label: Menübezeichnung
              description: 'Bezeichnung, die im Menü verwendet werden soll. Wenn kein Eintrag gewünscht ist, dann leer lassen. Es werden keine Untermenüs generiert.'

Afaik the ordering@ directive only works within a fields section, so you only can order items within a specific tab.

I hope you get it work.

Best regards.

1 Like

Yes, it does work like that – I was just wondering whether there was an easier way. So thank you for confirming this is the way to go!

1 Like