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

Why do theme functions only run once?

Started by Jayesh Gohel 8 years ago · 3 replies · 771 views
8 years ago

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.

8 years ago

Have you disabled the (twig) cache for this page?

8 years ago

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']
---
8 years ago

Seems like this problem has been around for some time.
/forum/forms-blueprints/form-field-set-by-url-parameter-t9281?u=gnat

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1139 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 63 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 137 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 112 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 131 7 months ago