Forum
How can I output comments by type?
I love the new Webmentions functionality! Thinking about the optimal way to display comments now that I have Webmentions set up, I would like to try and get something like this:
// actual comments
// comments of type ‘Share’: as they appear now
// comments of type ‘Like’: A, B, C, D and E liked this post
// comments of type ‘Retweet’: F, G and H retweeted this post
(In which A-H would maybe be the people, and maybe be links to the actual tweets?)
So my question is: can I get arrays of comments by type, in order to do something like the above?
I'm using
<perch:if>
conditionals in mycomment.html
template to do something similar.@Clive: that sounds very useful. Should something like
<perch:if type="Like">
work? If I try that, all the comments seem to get matched, so I'm probably doing it wrong. Curious what yourcomment.html
looks like!I'm using
<perch:if id="webmentionType" value="like">
My
comment.html
template below. Still testing this. And I'm only differentiating between Likes and Reposts in the webmentions section at the moment.Other smarter ways of doing this may be available :-)
I'm using Bridgy to generate the Likes etc. as described in Drew's post.
Oh thanks for this, that's brilliant! Will have a play with it (in fact I have, locally… works a charm)
I did not know
id="webmention"
was something that could be used there. What would be the best place to find out about the attributes that can be used in<perch:if>
?You can use
<perch:showall />
in your template to see what fields are available, see https://docs.grabaperch.com/perch/content/templates/using-perch-showall/Also, the
<perch:if>
docs here https://docs.grabaperch.com/templates/conditionals/if/Hi Clive! Sorry I did go a bit off topic there. But many thanks for sharing this, I had no idea this existed! Cheers!