- changed status to open
Good morning,
How can i do a couting comments outside a post blog for example, inside the post of blog i can do comments|length .. but outside of that post from blogList for example i can't call that variable because does not exist?
Any idea about how to fix that please?
Thank you.
Comments (4)
-
repo owner -
repo owner - changed status to resolved
In v.2.0.5 you can use
{{ comments_number(post.slug) }}
function. -
reporter Thank you very much, it's working fine!
-
Hi Alexey, I have the same issue. However the solution you mentioned above in the comment is not working for me. It seems I do something wrong with :slug. On my page with filename “blog/post.htm” & Url :” /blog/post/:slug “ the {{comments|length}} works fine. On my blog.htm page with url “ /blog/:page? ”
{{ comments_number(post.slug) }}
is not working and{{ comments|lenght }}
shows the total amount of comments instead of the comments related to that single blog post. I use :slug in my component. - Log in to comment