Skip to content

Instantly share code, notes, and snippets.

@wdzajicek
Last active August 31, 2018 14:16
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 wdzajicek/7eb63a168d86e21f3405eec7fcffe634 to your computer and use it in GitHub Desktop.
Save wdzajicek/7eb63a168d86e21f3405eec7fcffe634 to your computer and use it in GitHub Desktop.
<style>
//add bellow styles to only display in CC editor interface
// ==============================================================
.editor-link {
display: none;
}
.cms-editor-active .editor-link {
display: block;
}
</style>
<!-- Post rollup post editor-button example from CC docs -->
<!-- from https://docs.cloudcannon.com/editing/editor-links/#doc -->
<ul class="blog-posts">
{% for post in site.posts %}
<li class="blog-post">
<h3>{{ post.title }}</h3>
<p>{{ post.excerpt }}</p>
<a href="{{ post.url }}">Read more</a>
<!-- Editor Link -->
<a href="cloudcannon:collections/{{ post.path }}" class="editor-link">Edit post</a>
</li>
{% endfor %}
</ul>
<!-- Idea for post approval button for new.html page -->
<!-- Create new front-matter boolean field for '_display_post:' set defuault to false in _config.yml -->
<ul class="blog-posts">
{% for post in site.posts %}
<li class="blog-post">
<h3>{{ post.title }}</h3>
<p>{{ post.excerpt }}</p>
<a href="{{ post.url }}">Read more</a>
<!-- Editor Link -->
<a href="cloudcannon:collections/{{ post.path }}" class="editor-link">Edit post</a>
<a href="cloudcannon:#_display_post" data-cms-editor-link-style="modal">Display Post</a>
</li>
{% endfor %}
</ul>
<!-- Meanwhile on the index page's post roll-up -->
<ul class="blog-posts">
{% for post in site.posts %}
{% if post._display_post == true %}
<li class="blog-post">
<h3>{{ post.title }}</h3>
<p>{{ post.excerpt }}</p>
<a href="{{ post.url }}">Read more</a>
<!-- Editor Link -->
<a href="cloudcannon:collections/{{ post.path }}" class="editor-link">Edit post</a>
<a href="cloudcannon:#_display_post" data-cms-editor-link-style="modal">Display Post</a>
<!-- May be this -->
<a href="cloudcannon:#post._display_post" data-cms-editor-link-style="modal">Display Post</a>
</li>
{% endif %}
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment