I have created a custom editing tab in my custom blueprint for a client. I would like to move Taxonomies (of which I have only declared the Tags field) into my new tab. The docs cover replacing, unsetting etc but not repositioning (it seems).
I think I could undefine the field and then copy it into my new tab as a new field but this seems repetitive. I tried import@
but it didn’t work, possibly because I wasn’t referencing the Taxonomies field properly.
I also tried overriding it in my custom blueprint (options.fields.taxonomies.header.taxonomy
) and setting ordering@
but that had no effect either.
I suspect there is a simpler way to simply move the field.
@hughbris, Using Quark and its /blueprints/default.yaml, the following blueprint:
- Removes field Taxonomies from tab Options
- Creates a new tab NewTab containing field Taxonomies
extends@: default
form:
fields:
tabs:
fields:
options: # Existing Options tab
fields:
taxonomies: # Existing Taxonomies section
unset@: true # Unset entire section
newtab: # Create new tab
type: tab
title: New Tab
fields:
taxonomies: # Create Taxonomies section
type: section
title: PLUGIN_ADMIN.TAXONOMIES
underline: true
fields:
header.taxonomy: # Create Taxonomy field
type: taxonomy
label: PLUGIN_ADMIN.TAXONOMY
multiple: true
validate:
type: array
Result:
![Untitled](https://canada1.discourse-cdn.com/flex036/uploads/getgrav/original/2X/e/eae6f7c1b7dc2d07a758c8a006aa22f7b8ed5ee5.png)
![Untitled](https://canada1.discourse-cdn.com/flex036/uploads/getgrav/original/2X/4/486f4c9737f0c6da164c34d3475b595200d346ff.png)
Note:
- I’m not aware of a simpler and less repetitive way…
-
unset@: true
must be the only or last line in a field definition. Keeping an existing field definition and adding unset@: true
as first property won’t work. It must be the last property or only property.
3 Likes
Thank you, I’ve done that for now and it works. I didn’t know those rules about @unset
.
I hope you don’t mind me not marking that as a solution. I find if I am lucky enough to have a workaround and then move on, that my solution turns up when I am not looking for it.