0

What's the best way (DRY) to get the comments of the current entry with stash?

So far I used a embed-template to present all comments and the comment-form. But this does not work within stash — and isn't there a smarter way than a embeded tempalte?

{exp:channel:entries channel='news' limit='1' dynamic='on' require_entry='yes' track_views='one'}
…
{exp:stash:set name='entry_comments' parse_tags='yes'}{embed='_interactive/comments' channel='{channel_short_name}' comment_total='{comment_total}' {if allow_comments}allow='yes'{/if}}{/exp:stash:set}
…
{/exp:channel:entries}
SQB
  • 3,926
  • 2
  • 28
  • 49
albuvee
  • 2,744
  • 6
  • 28
  • 38

1 Answers1

1

This gist from Mark Croxton is for an articles listing page that includes comments. It does a bit more than what you're describing in your scenario, but you might be able to use some of the concepts.

Tyssen
  • 1,569
  • 16
  • 35