LauraB
14 years agoGenius
most read articles
Hello everyone!
I'm wanting to pull the most read articles from a specific label into a widget to be displayed on a separate page than the blog itself - has anyone had any success coding this t...
Assuming you have a widget container setup, I think this would work for you.
<#assign view_threshold = 100 /> <#list rest("/blogs/id/MYBLOG/posts/for/labels/text/MYLABEL").node_message_context.message as message> <#if (message.views.count?number > view_threshold)> <li><a href="${message.@view_href}">${message.subject}</a></li> </#if> </#list>
Where MYBLOG is your blog ID and MYLABEL is the desired label. You'll want to adjust the view_threshold value, too. This should print one blog entry per row in an HTML list.