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

Default frontend form fields from authenticated user

form

Started by Dieter Tremel 8 years ago · 0 replies · 713 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 Japhy, 2 weeks ago
2 271 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