Skip to content

Instantly share code, notes, and snippets.

@wvuwebgist
Created January 15, 2021 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvuwebgist/1dada3127dad5ac1d317d6b2841971fe to your computer and use it in GitHub Desktop.
Save wvuwebgist/1dada3127dad5ac1d317d6b2841971fe to your computer and use it in GitHub Desktop.
A profile index CleanSlate CMS template that only outputs a linked name for each child page written in Liquid.
---
layout: default
---
{% comment %} First, we must get the ID of the current profile_index page, then assign it to a "pages" variable: {% endcomment %}
{% assign pages = site | get_page: page.id %}
{% comment %} Then we take the "pages" variable, get the children from that variable and assign it to a "profiles" variable which we iterate through: {% endcomment %}
{% assign profiles = pages.children %}
{% for profile in profiles.all %}
<h2> <!-- Outputs each person's name: -->
<a href="{{ profile.url }}">
{{ profile.content['wvu-profile__name'] }}
</a>
</h2>
<!-- Probably pull more info here -->
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment