Extension, Fieldtype, Module


Popular - The Advanced View Counter for ExpressionEngine

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Notebleu


You must be logged in to post.

Custom channel fields inside the {exp:popular:most_popular} loop



I’m coding a module that returns the five most popular posts for the past thirty days. My channel entries have some important data in custom channel fields that I need to access in the module. When I code the loop as shown below, the custom fields work, but every time the module is loaded in a page all 5 entries get an additional count. Is there a better way to get the channel fields to work?

{exp:popular:most_popular channel_ids=“11” limit=“5” start_on=”<?php print strtotime( ‘-30 days’, time()); ?>” sort=“desc”}
{exp:channel:entries entry_id=”{entry_id}” dynamic=“off”}

...blah blah ...



# 1

Hi mavrekh,

Try disabling the extension for that channel by going to Add-ons > Extensions > Popular (Settings) in the Control Panel and deselecting the channel in “Allowed Channel Id’s”.  Then add this tag wherever you want an entry to be counted: {exp:popular:track_view} the track_view tag can take either an entry_id or a url_title as a parameter.  More on that here: https://notebleu.com/software/popular.  That will ensure that your entry is never double counted by the extension.

Let me know if that helps resolve this for you.

# 2

Thank you for your quick response. This did the trick.