Skip to content

Instantly share code, notes, and snippets.

@jasonvarga
Last active January 1, 2016 15:59
Show Gist options
  • Save jasonvarga/8168020 to your computer and use it in GitHub Desktop.
Save jasonvarga/8168020 to your computer and use it in GitHub Desktop.
Related entries using Statamic's Suggest fieldtype
--
title: My Post
related_entries:
- /blog/related-post-1
- /blog/related-post-2
---
This is actually your post's md file. I named it txt otherwise Github will try to format it as markdown and it looks funky.
<h1>{{ title }}</h1>
{{ content }}
<h2>Related Entries</h2>
<ul>
{{ entries:listing folder="blog" conditions="url:{related_entries_option_list}" }}
<li><a href="{{ url }}">{{ title }}</a></li>
{{ /entries:listing }}
</ul>
fields:
related_entries:
type: suggest
display: Related Entries
hide_selected: true
content:
folder: blog
label: title
value: url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment