Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Child Collection

Started by Muut Archive 11 years ago · 4 replies · 249 views
11 years ago

I am having issues getting the children to show up in my collection. It is showing there are two children, which is correct. I just can't seem to get it to show the YAML info I need.

TWIG
{% for child in page.collection %}
  <li>{{ child.header.title }}</li>
{% endfor %}

YAML:

YAML
title: Sample Photo
menu: sample_photo
class: ""
galleryinfo:
    date: May 25-27, 2015
    video:
    id: photo
    placeholder: opgp1_thumb.jpg
photos: 
    - modalid: 1
      image: opgp1.jpg
      title: Paradigm 
      desc: "Donec id elit non mi porta gravida at eget metus. Cras mattis consectetur purus sit amet fermentum."
    - modalid: 2
      image: opgp2.jpg (...)

(cont. down to list 10 photos)

I have done this in several different places already, I just can't seem to see a difference in what I am doing here.

11 years ago

ok....

The solution/problem seems really dumb. I didn't have another line in my .md file after the closing --- of the YAML. It's showing fine by just adding a return to that line.

11 years ago

Hmm.. that's strange, because I distinctly remember testing that. I'll check it again though. Glad you found a simple work-around.

11 years ago

FYI i just checked and a blank line should not be required after the closing --- of the header frontmatter. Works for me with or without it.

11 years ago

it was just a weird, late night. I was trying all kinds of different things. It might have been a coincidence that it worked after I changed the .md file.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1323 9 years ago
Archive · by Muut Archive, 9 years ago
2 920 9 years ago
Archive · by Muut Archive, 9 years ago
2 4048 9 years ago
Archive · by Muut Archive, 9 years ago
1 2924 9 years ago
Archive · by Muut Archive, 9 years ago
3 1106 9 years ago