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 →

Why do theme functions only run once?

Started by Jayesh Gohel 9 years ago · 3 replies · 1102 views
9 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.

9 years ago

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

9 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']
---
9 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 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