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

Import blueprint form field names

Started by Paul 9 years ago · 2 replies · 823 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 Ton Haarmans, 5 years ago
13 1138 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 135 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 129 7 months ago