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

Default frontend form fields from authenticated user

form

Started by Dieter Tremel 8 years ago · 0 replies · 552 views
8 years ago

A form can be filled only by an authenticated user and I want to set hidden and non hidden fields from the active (authenticated) user.

I tried Twig in Frontmatter like default: {{ grav.user.email }}, but this did not work, even if activated in config/system.yaml.

YAML
  frontmatter:
    process_twig: true
    ignore_fields:
      - form
      - forms

I tried
data-default@: '\Grav\Plugin\Login::getUser::fullname'
data-default@: ['\Grav\Common\User\User::value', 'email']

but this did not work. Is it possible to access information of authenticated user in form frontmatter? Any "How To" for me?

Thank you
Dieter

Updated 22.06.2018 for clearification.

last edited 06/22/18 by Dieter Tremel

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 62 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 136 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 130 7 months ago