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

Adding custom form data to the page

Started by Muut Archive 10 years ago · 1 replies · 464 views
10 years ago

I have created a from field in my admin area to have an additional piece of content for the page. What do I need to add to the page to grab this data and place it on the page? I am using the following sample code in my blueprint:

YAML
      fields:
        header.an_example_text_field:
          type: text
          label: Add a number
          default: 5
          validate:
            required: true
            type: int
10 years ago

just add in your template
{{ page.header.anexampletext_field }}
and it should output the content saved in the admin

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2555 9 years ago
Archive · by Muut Archive, 9 years ago
2 1685 9 years ago
Archive · by Muut Archive, 9 years ago
2 4973 9 years ago
Archive · by Muut Archive, 9 years ago
1 3799 9 years ago
Archive · by Muut Archive, 9 years ago
3 1795 9 years ago