Search

Hi,

I'm struggling to find a way to sort articles or blog posts by popularity (page views). I've looked into the increment number field extension, but it doesn't appear to be working on symphony version 2.3.

Just wondering if anyone has any suggestions for a different approach?

Thanks

An AJAX call that just saves a higher value every time the page is loaded?

  • Create a field called "popularity"
  • Create an event that saves to this section
  • Output the "popularity" value to some hidden input or data attribute in the HTML.
  • Use an AJAX call to read that value, increment it by one, save it to another page that has the event attached to it.

I've got this somewhere down in my to-do list. I was planning on making something using the Google Analytics API. its still some way off - and not sure if that would be interesting for you.

If you post any data from the frontend, I highly recommend the Default Event Values extension. In order to protect your entry data, you can set empty field values overriding any posted field data.

My approach would be to use Increment Number field, but it does need updating. I never got around to it, but I really should.

If you go with the AJAX updater idea, be sure that the field you use is a Number field and not a normal Text Input field, which allows true numerical sorting.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details