We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Trouble wiring up my page data with my template

Ed Talmadge April 5, 2019 by Ed Talmadge

My goal is to show a quote using a replicator field and an image using an assets field. I've tried a variety of experiments on my template (templates/foo.html), but am unable to get any data to appear via antlers. I am new to Statamic and am likely doing something fundamentally wrong.

What am I doing wrong?

My routes.yaml file is blank.

My templates folder contains one file: templates/foo/index.html

The page (index.md)


template: foo/index hero: - /assets/hero.jpg quote: - type: set_1 quote: - type: text text: '<p>Hello World!</p>' name: 'John Doe' position: Center company: 'Acme, Inc.' title: Test fieldset: foo id: f97a0886-a676-45b2-b423-c3ee0f15e24b

The template

Does not work (everything shows up except the antlers replacements). I've stripped it down to the bare minimum.

<img src="{{ hero-image }}" alt="{{ alt }}" />

<blockquote>{{quote}}</blockquote>
<p>{{name}}, {{ position }} | {{ company }}</p>

The fieldset

sections:
  main:
    display: Main
    fields:
      hero:
        container: main
        folder: /
        restrict: false
        type: assets
        display: Hero

      quote:
        sets:
          set_1:
            display: 'Quote Fields'
            fields:
              quote:
                sets:
                  set_1:
                    display: 'Quote Fields'
                    fields: {  }
                type: bard
                display: quote
              name:
                type: text
                display: Name
              position:
                type: text
                display: Position
              company:
                type: text
                display: Company
        type: replicator
        display: Quote 
Answered by Erin Dalzell!
>>>>>>> Answered <<<<<<<
6 Replies
2 Followers