I am trying to set a default value in a form using static Theme function. However it seems theme functions only execute once, a page refresh does not update the page values.
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Forms & Blueprints
Have you disabled the (twig) cache for this page?
Yes I have set cache_enable: false. Here's the folder structure for your reference -
YAML
- 01.home
- default.md
- 02.demo
- form.md
Frontmatter for form.md (under 02.demo folder) is as follows -
YAML
---
title: Demo
cache_enable: false
form:
fields:
- name: name
type: text
label: Hello World
data-default@: ['\Grav\Theme\Antimatter::getQuery', 'product']
---
Seems like this problem has been around for some time.
/forum/forms-blueprints/form-field-set-by-url-parameter-t9281?u=gnat
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 13 | 1139 | 4 months ago | ||
| 0 | 63 | 5 months ago | ||
| 9 | 137 | 6 months ago | ||
| 7 | 112 | 7 months ago | ||
| 10 | 131 | 7 months ago |