Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
An extension to show content items that are linked to the current item.
<link href="" rel="stylesheet">
<script src=""></script>
<script src=""></script>
body {
margin: 0;
color: #8091a5 !important;
overflow: hidden;
p {
margin-top: 0;
margin-bottom: 1em; }
ul {
padding-left: 2em;
<div id="content"></div>
<script id="template" type="x-tmpl-mustache">
There are {{terms.length}} term(s) linked to this chapter.
<li><a title="{{fields.synonyms.en-US}}" href="/spaces/{{}}/entries/{{}}" target="_blank">{{fields.title.en-US}}</a></li>
window.contentfulExtension.init(function (extension) {{
'content_type': 'term',
'order': 'fields.title',
'': extension.entry.getSys().id,
'locale': 'en-US'
var rendered = Mustache.render(document.getElementById('template').innerHTML, {terms: results.items});
document.getElementById('content').innerHTML = rendered;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment