Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Import blueprint form field names

Started by Paul 9 years ago · 2 replies · 1261 views
9 years ago

I want to re-use a blueprint for multiple fields, but the docs only give an example for a named field.

import@: for blueprints is described in the docs with this form definition:

YAML
form:
  fields:
    gallery.images:
      type: list
      label: Images
      fields:
        .src:
          type: text
          label: Image

and use like so

YAML
form:
  fields:
    images:
        type: section
        title: Images
        underline: true
        import@:
          type: partials/gallery
          context: blueprints://

this will write a list to gallery.images in the markdown. But what if I want to re-use partials/gallery for another gallery? e.g. gallery2.images

9 years ago

I don't think this is currently supported. It's getting a bit fiddly when you want to reuse things at that micro-scale.

9 years ago

I'm trying to reproduce my template, which is built from reusable partials, in blueprint. So far I have had to be very redundant in the blueprint.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Japhy, 2 weeks ago
2 270 4 days ago
Forms & Blueprints · by FrViPofm, 4 weeks ago
5 329 4 weeks ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2320 8 months ago
Forms & Blueprints · by Hugo Oliveira, 9 months ago
0 781 9 months ago
Forms & Blueprints · by Flachy Joe, 10 months ago
9 871 10 months ago