Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Default frontend form fields from authenticated user

form

Started by Dieter Tremel 8 years ago · 0 replies · 790 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 Anna, 2 days ago
2 53 16 hours ago
Forms & Blueprints · by Anna, 3 days ago
7 82 16 hours ago
Forms & Blueprints · by Anna, 1 week ago
5 186 6 days ago
Forms & Blueprints · by TomW, 1 month ago
3 379 1 month ago
Forms & Blueprints · by Japhy, 2 months ago
2 595 2 months ago