Created
January 15, 2021 21:28
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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