Skip to content

Instantly share code, notes, and snippets.

@john-henry
Created May 18, 2015 13:30
Show Gist options
  • Save john-henry/827e09230b88ba1359e7 to your computer and use it in GitHub Desktop.
Save john-henry/827e09230b88ba1359e7 to your computer and use it in GitHub Desktop.
Show list of subscribed entries via Comment add-on and Stash for logged in users in ExpressionEngine.
{exp:stash:set_list name="author-comments" parse_tags="yes" parse_depth="2" refresh="6" save="yes" scope="site" replace="no"}
{exp:comment:entries sort="asc" limit="500" dynamic="no" author_id="{member_id}"}
{stash:comment-title}{title}{/stash:comment-title}
{stash:comment-entry_id}{entry_id}{/stash:comment-entry_id}
{/exp:comment:entries}
{/exp:stash:set_list}
<ul>
{exp:stash:get_list name="author-comments" unique="yes" parse_tags="yes" parse_conditionals="yes" orderby="comment-title"}
<li>
<h4>{comment-title}</h4>
{exp:comment:notification_links entry_id="{comment-entry_id}"}
{if subscribed}
<a href="{unsubscribe_link}" class="btn btn-xs btn-primary">UnFollow</a>
{if:else}
<a href="{subscribe_link}" class="btn btn-xs btn-viewmore">Follow</a>
{/if}
{/exp:comment:notification_links}
</li>
{/exp:stash:get_list}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment