Last active
January 1, 2016 15:59
-
-
Save jasonvarga/8168020 to your computer and use it in GitHub Desktop.
Related entries using Statamic's Suggest fieldtype
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
-- | |
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. |
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
<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> |
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
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