3

I want to have a kind of 'trending' or 'most popular' area on my homepage which lists the top 10 most popular articles.

Is there a simple way to order entries by popularity?

2 Answers 2

11

Sure - first you need to track views in order to determine popularity. So on your "single entry" templates, add track_views="one" to your channel:entries tag.

Then, you can use orderby="view_count_one" on your channel:entries listings tags.

1

View Count + Total Comments

You can also use the variable {comment_total} in conjunction with {view_count_one} for an alternate assessment of popularity.

On the exp:channel:entries listing tag

orderby="view_count_one|comment_total"

Conditional might be

{if comment_total >= '10' AND view_count_one >= '10' }
This entry is trending
{if:else}
This is a regular entry
{/if}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.