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.

Clarification on related entries and view_count_x compatibility

March 16, 2011 11:55am

Subscribe [6]
  • #1 / Mar 16, 2011 11:55am

    dehuszar

    99 posts

    I’m planning out some development for a client.  They need to be able to track views to gauge popularity, and we also need to set up some relationships between channels.

    I was looking through the documentation here and saw the note on view_count_x tags not being supported.  I wanted to clarify something real quick.

    Does that mean you can’t use them together AT ALL, or does it mean you can’t pass view_count_x data from related entries when referencing the entry currently in view?

    Any insight would be appreciated.

  • #2 / Mar 16, 2011 11:28pm

    Sue Crocker

    26054 posts

    Hi, dehuszar, it’s only when using them inside of related entries. If you use a single entry page and one of the view_counts, it’ll work just fine. (Example: track_views=“one”)

    Does that help?

  • #3 / Apr 23, 2011 5:33pm

    lehrerfreund

    263 posts

    Hi Sue, I have exactly the same question, allow me to ask further:
    What do you mean with “when using them inside of related entries”?

    I have the same situation as dehuszar and it is important for me to keep track of the views.

  • #4 / Apr 23, 2011 10:33pm

    giusi

    94 posts

    Hi lehrerfreund, I think Sue means that view count doesn’t work when used like this:

    {exp:channel:entries}
    {related_entries id="field_name"}
    {view_count_one}
    {/related_entries}
    {/exp:channel:entries}

    In this case {view_count_one} won’t work. The reason is that the related entries data is cached (saved to be displayed later) when you create the entry those will be related to. Dynamic entries data can’t be displayed in this context.

    Hope I made it clear enough.

  • #5 / Apr 24, 2011 3:08pm

    Greg Salt

    3988 posts

    Hi lehrerfreund,

    Guisi is correct. Does that satisfactorily answer your question?

    @dehuszar, are you okay with this now?

    Cheers

    Greg

    @guisi, thanks very much for your help.

  • #6 / Apr 24, 2011 8:01pm

    lehrerfreund

    263 posts

    I think I’ve understood how it works, giusi. Thank you for the clear explanation!!

    Thanks also for confirming, Greg.

    (my case closed)

  • #7 / Apr 25, 2011 5:17am

    John Henry Donovan

    12339 posts

    Thanks

    dehuszar, let us know if all is ok with you?

    Also spotted a release of an add-on the other day called Hits which has some relevance here

  • #8 / Apr 25, 2011 5:25am

    lehrerfreund

    263 posts

    (uih, hits looks nice, though it will take some while to use it: “Hits requires Expression Engine 2.3+” 😊

  • #9 / Apr 25, 2011 5:30am

    John Henry Donovan

    12339 posts

    lehrerfreund,

    😊 nice spot. If you have time it would be nice to let the author know

  • #10 / Apr 25, 2011 5:33am

    lehrerfreund

    263 posts

    already did this 😊

  • #11 / Apr 25, 2011 6:29am

    John Henry Donovan

    12339 posts

    I am actually gonna close this one out as the original thread was a while back. Feel free everyone to start a new thread if you have any more questions

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

ExpressionEngine News!

#eecms, #events, #releases