Alternate Way to Make Automatic Public Previews

I wanted to:

  • Make a public preview for every post automatically
  • Not have to manually insert preview cards or figure out API insertion
  • Be able to change how much preview content was shown across the entire site with one setting

The solution was completely counterintuitive because it requires making every post public. What non-members see gets limited by setting a content word limit in the theme file.

If the user is a member, it shows the full content. If the user is not logged in, it shows the first 300 words only. This is still a hard wall because the excess words aren’t loaded in the page source.

In content.hbs, in place of

    <div class="single-content gh-content gh-canvas">
        {{content}}
    </div>

Use

{{#if @member}}
   <div class="single-content gh-content gh-canvas">
	  {{content}}
</div>
  {{else}}
	  <div class="single-content gh-content gh-canvas">
		  {{content words="300"}}
***You will need to manually add a sign up form or call to action here. Since the post is public access, the system CTA won't show.***
</div>
  {{/if}}

This solution works for me because I have one tier of content I want behaving the same way. Every post will show 300 words and you have to be logged in to view the rest.

You can play with both post filters and member filters if you want to show some full posts or have multiple tiers of access.

Cool solution. Be aware that this won’t limit what can be retrieved from the content api or rss feed (unless you customize).