Skip to content

Instantly share code, notes, and snippets.

@adamjohnson
Created May 18, 2020 16:44
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 adamjohnson/e9115dbf3da78a02b744e66c33785aeb to your computer and use it in GitHub Desktop.
Save adamjohnson/e9115dbf3da78a02b744e66c33785aeb to your computer and use it in GitHub Desktop.
Use CleanSlateCMS to output JSON for a profile index template.
[<r:children:each limit='{$limit}' labels='{$labels}'>
{
"id": <r:page:id />,
"page_published_at": "<r:date_format format='httpdate' value='{page:published_at}' />",
"page_url": "<r:page:url />",
"page_name": "<r:page:name />",
"page_alternate_name": "<r:page:alternate_name />",
"profile_name": "<r:page:content name='wvu-profile__name' />",
"profile_job_title": "<r:page:content name='wvu-profile__job-title' />",
"profile_email": "<r:escape_xml><r:page:content name='wvu-profile__email' /></r:escape_xml>",
"profile_phone": "<r:page:content name='wvu-profile__phone' />",
"profile_short_description": "<r:page:content name='wvu-profile__short-description' />",
"profile_photo": "<r:escape_xml><r:page:content name='wvu-profile__photo' absolute_urls='true' /></r:escape_xml>"
}<r:next_sibling>,</r:next_sibling>
</r:children:each>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment