We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7193
    • 9 Posts
    Hi I have a little news archive made with Ditto. Can I add a chunk to show the total of readers on the articlepage?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      MODx doesn’t have a built-in visitor logging feature, but you can use any number of scripts and online services for this.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 36404
        • 307 Posts
        hi,

        or you could write your own quite easily smiley
        - create a tv that you’ll call "visits" for example (choose "number" and set the defaul value to 0)
        - write down the new tv id (well keep it in mind but due to my age i like to write things smiley)
        - write a snippet that will, on opening the full article page, update your prefix_site_tmplvar_contentvalues table setting value = value + 1 where (important) tmplvarid = the famous id you’ve written down smiley and contentid = the ressource (full article) id
        - call your snippet [[yourvisitsnippet! &pageid=`[*id*]`]] in your article template

        done! this way you’ll even be able to give that stat article by article on the article summaries page as ditto is able to get TVs

        have swing
          réfléchir avant d'agir
          • 7193
          • 9 Posts
          i’m a bad programmer smiley i’ve found a page tracker but that one is for evolution, and i’m having revo..

          but thanks you both!