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

Dynamic Fields as mentioned in grav documentation

Started by Abdul Shaikh 6 years ago · 4 replies · 773 views
6 years ago

Does anyone know how to generate dynamic field properties using 'data-fields@ ' ? On grav documentation it is mentioned that we can use data-type / label / validation / field but no example is given how ? Can anyone point me in the right direction ?

6 years ago

Hello @I4mabdul, welcome to the Grav forum.

The documentation on dynamic fields is rather basic.

The Form Prefiller Plugin though has a couple of use cases in it's example page like setting option field values, getting the current time and date and localised field labels based on the Grav active language.

6 years ago

Thanks @bleutzinn . Appreciate your help. I was wondering if we could generate fields like label => ' Name' , 'type' => ' text ' using 'data-fields@' ?
Basically my idea is to output label from one blueprint and have text field generated against it using 'data-fields@' in another blueprint so that i can edit it using admin panel.

6 years ago

You can. When you set values for label and type through a form which uses the first blueprints and then use data-label@ and data-type@ in the second. I've never tried data-type@ but in theory it should work.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1165 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 89 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 163 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 138 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 156 7 months ago