ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

BLOG: How would I show popular content - the most read posts?

June 05, 2012 11:36pm

Subscribe [3]
  • #1 / Jun 05, 2012 11:36pm

    Kubik101

    155 posts

    =)

  • #2 / Jun 06, 2012 10:09am

    Rob Allen

    3114 posts

    First you need to set up entry tracking - http://ellislab.com/expressionengine/user-guide/modules/channel/entry_tracking.html - this will count how many times an entry has been viewed. After that add a Channel entries tag to show your most viewed entries (see sample code at http://ellislab.com/expressionengine/user-guide/modules/channel/entry_tracking.html )

  • #3 / Jun 06, 2012 7:55pm

    Kubik101

    155 posts

    The example doesn’t seem to explain what I want to achieve.

    I would like to track how many times blog posts are viewed then on the home page show the top 10 most viewed posts.

    Am I missing something or is this not what tracking is for?

  • #4 / Jun 06, 2012 8:50pm

    Rob Allen

    3114 posts

    Entry tracking counts how many times an entry has been viewed. Once you add the parameter to the Channel entry tag that you want tracked EE will then start counting. You can then use another channel entries tag to show your top 10 list using the {view_count_xxx} parameter.

    Example top 10 list tag:

    {exp:channel:entries channel="yourchannel" limit="10" orderby="view_count_one" sort="desc"}
    {title} viewed {view_count_one} times
    {/exp:channel:entries}
  • #5 / Jun 07, 2012 12:22am

    Kubik101

    155 posts

    Ahh OK perfect.
    Thank you so much.
    =)

  • #6 / Sep 14, 2012 8:54pm

    JulesWebb

    271 posts

    Hello

    I’ve implemented something similar to the example bluedreamer presented above in my website’s sidebar.
    When I am on mysite.com/blog it presents a list of the 5 most viewed entries as expected.
    But if I’m viewing an entry like mysite.com/blog/my-post-title the only entry that shows in the list is from the page I’m currently viewing.

    The sidebar is brought in with an embed

    {embed="{embed_tempgroup}/_aside"}

    Below is the code I’m using to create the list.

    <ul>
    {exp:channel:entries channel="blog" status="open" limit="5" orderby="view_count_one" sort="desc"}
        <li><a href="http://{path={channel_name}/{url_title}}">{title}</a></li>
    {/exp:channel:entries}
    </ul>

    Any ideas on what the snag might be?


    EE v2.5.2 - Build Date: 20120606

     

  • #7 / Sep 18, 2012 1:51pm

    JulesWebb

    271 posts

    Silly me, All I needed was to add dynamic=“no” to my EE call

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases