Cannot apply data in custom template

Hi there.

Im trying to retrieve certain posts in an specific template.

My routes.yaml looks like this:

routes:
  /tos/:
    data: page.tos
    template: tos
  /privacy/:
    data: page.privacy
    template: privacy
  /about/:
    data: page.about
    template: about
  /influence/:
    template: case-studies
    data: tag.casestudies

collections:
  /:
    permalink: /{slug}/
    template: index

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

And im trying to call the information in my template like this:

{{#tag}}
{{#foreach "posts"}}
<section class="case-studies-posts">
    <h1 style="color:black">{{title}}</h1>
    {{content}}
</section>
{{/foreach}}
{{/tag}}

The template itself is being display but not the content.

The templates with the data.page works fine.

Any suggestions?

Thank you!

Done!
Solved it with controllers

1 Like