Outputting data from custom fields

Im sure this is a very rudimentary question, but I am having issues outputting data stored from my custom fields. Is there something I am missing when trying to output data from a custom text form field? If I have fields in different tabs, is outputting the data the same or do I have to reference that tabs somehow? Hopefully this makes sense.

*note: the text field is only holding one entry. There isn’t a list of entries. I know my twig forloop is probably wrong, but this is the only example of outputting data from the custom field I could find. I haven’t seen an example in twig documentation or on grav that’s the equivalent of <php echo="$location" ?>; most examples are of pulling data out of loop.

my template is event.html.twig

Template:

{% for location in page.overview.location %}
{{ location }}
{% endfor %}

Blueprint:

overview.location:
type: text
label: Event Location
style: vertical
size: medium

I think I figured out my issue. I wasn’t prefixing my fields with “header.” so my data wasn’t storing. Therefore I couldnt see my data. Once I prefixed the field like so in my blueprint,

header.overview.location

I was able to echo out the data like so on the template

<div>{{ header.overview.location }}</div>

1 Like