Keyword

K2 Content Module - Time range not working as expected.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago - 9 years 3 months ago #150654 by Tyler Ancell
Hi there,

I'm having a bit of trouble getting the K2 content module to work in the way I'm assuming it should work.

My current settings are as follows:
Source: Retrieve Items from Categories
Select Categories: I've selected the categories I want to pull items from
Fetch items from children: Yes
Item Count: 8
Item Ordering: Most popular
Time Range: 1 week

What I expect to happen, is that K2 displays the most popular (most viewed) items over the past week. Setting it to 1 week displays nothing, 2 weeks displays nothing, 1 month shows one item, 3 months shows eight items.

I have many items on my site that are viewed many times daily by many people, yet articles still do not display under the most popular setting.

Ideally I'd like to have this set to 1 or 2 days.

What can I do to fix this?
Last edit: 9 years 3 months ago by Tyler Ancell.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • User
More
9 years 3 months ago #150659 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Content Module - Time range not working as expected.
Hello,

Which version of Joomla! and K2 are you using?
Are you using overrides for that module?

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago - 9 years 3 months ago #150661 by Tyler Ancell
I'm using K2 2.6.9

I am using a module override, but I've have not changed any php, I've only changed the html to make use of bootstrap.


Edit: The K2 Content module that I used to make my override was from the 2.6.9 package as well.
Last edit: 9 years 3 months ago by Tyler Ancell.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • User
More
9 years 3 months ago #150663 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Content Module - Time range not working as expected.
Which caching method are you using? Are the hits being stored in the database?

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago - 9 years 3 months ago #150664 by Tyler Ancell
I've tried it with caching on and off, no change.

When caching is enabled, I use conservative caching, and I've disabled caching for the k2 content module.

Edit: Hits are being stored in the database, yes - sorry, forgot to add that.
Last edit: 9 years 3 months ago by Tyler Ancell.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • User
More
9 years 3 months ago #150669 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Content Module - Time range not working as expected.
Caching the module will produce any results other than showing changes more quickly.

Can you do a test for me please?

Can you disable the site's cache and navigate to some K2 items?

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #150670 by Tyler Ancell
Cache disabled (and cleared) and CDN disabled.

Set the module to 1 day, and nothing shows after visiting 5 different articles, 5 times each. K2 is counting the hits in the database in the backend.

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago - 9 years 3 months ago #150674 by Tyler Ancell
I've left caching disabled since my last message and still no change in items displaying.
Last edit: 9 years 3 months ago by Tyler Ancell.

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #150682 by Tyler Ancell
Any other suggestions on how to fix this?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • User
More
9 years 3 months ago #150701 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Content Module - Time range not working as expected.
Can you send me a link to your site?

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #150724 by Tyler Ancell

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #150731 by Tyler Ancell
I've posted the link to my site, though, I'm not sure how that will help - all I've changed was the html :(

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • User
More
9 years 3 months ago #150733 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Content Module - Time range not working as expected.
It does help. It is not an issue of your overrides. I accessed your site from three different browsers and the hits where not registering.
Is your server located behind or using a proxy?

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #150735 by Tyler Ancell
It's cached right now with a cron job set up to clear cache every 12 hours, hits refresh on the front end at that time. Hits are registering in the backend though.

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #150748 by Tyler Ancell
Actually, I'm wrong. The hits were not being added into the backend. I've made adjustments and hits are now being recorded properly, however, I did leave caching disabled for over a day and the most popular items were still not being populated correctly. I had the time range set to 1 day, and it still showed zero items.

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago #150772 by Tyler Ancell
Hits have been recording since my last post, still no change in how "Most Popular" is showing.

1 day, 3 days, and 1 week show nothing

2 weeks shows one item

1 month shows two items

3 month shows eight items

Please Log in or Create an account to join the conversation.

  • Lefteris
  • Lefteris's Avatar
  • User
More
9 years 3 months ago #150785 by Lefteris
@Tyler Ancell

The time range filter is applied on the items creation date not on the item hits. So setting this to 1 week for example will first fetch the last week's items ( if any ) and then sort them by the hits counter.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • User
More
9 years 3 months ago #150786 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Content Module - Time range not working as expected.
Have items been inserted items in that period?
Keep in mind that if no items have been inserted in the past x period, no items will be shown. Most popular items within a week, means that the module will fetch the most popular items that were created within the past week.

Please Log in or Create an account to join the conversation.

  • Tyler Ancell
  • Tyler Ancell's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 3 months ago - 9 years 3 months ago #150809 by Tyler Ancell
If that's the case, then its really not working as I thought it was supposed to :(

What I thought to be the case, was that the time range would show the most popular items over that time range. Like a "whats trending" sort of thing.

Something like this:

www.joomlahill.com/demos/5-recently-hit-articles

or

extensions.joomla.org/extensions/extension/news-display/popular-content/most-popular-content-by-date-range
(This one looks fairly simple, but my php skills are probably insufficient to rewrite this to work with K2 items rather than Joomla articles)

Would there be a way to duplicate and override the K2 content module and make it so it displays the most popular items within a specific time range, regardless of when the items were created?


Also, thank you for all your help so far, it's definitely appreciated!
Last edit: 9 years 3 months ago by Tyler Ancell.

Please Log in or Create an account to join the conversation.

  • Lefteris
  • Lefteris's Avatar
  • User
More
9 years 3 months ago #150816 by Lefteris
@Tyler Ancell

No, that's not so easy. In order to have trending items the way you want you need to track the time each item is hit. This is not done by K2, so this means that you need a third-party extension for that.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum