How to get a list of most popular articles in MODx?
Is there any way to get a list of most p开发者_如何学Copular(most viewed) articles in MODx? The documentation for getResources doesn't say anything in this context.
You could use the snippets Page hit counter and Page Hit Counter results to count visits and display them on your site.
There’s a dedicated solution for this now, using the “Extra” called “MostPopular”. https://modx.com/extras/package/mostpopular
You would track page views by calling the Snippet [[!mpLogPageView]]
and subsequently when you want to list the most popular resources you call [[mpResources]]
and pass the output to the getResources Snippet for templating.
精彩评论