We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46378
    • 20 Posts
    Hi. I'm using Articles add-on form my blog. I want to count each article post page hit, so I decide to use HitsPage add-on. I'm using
    [[!HitsPage? &saveTv=`true`]]
    to store hits counter in TV. It works well i article post. After each page refresh counter is increasing.

    The problem is in the articles list. In Articles page's content I've placed [[+articles]] tag to show the list of articles. In article row chunk I've put [[+tv.HitsPage]] to show each page counter, but the counter is not refreshing. It is refreshed only when I clear the cache.

    I've tried to make every call uncached but without luck. Any suggestions how to solve this problem?

    MODX Version: 2.2.5

      • 3749
      • 24,544 Posts
      You say you tried calling things uncached, did you try this?

      [[!+tv.HitsPage]]
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 46378
        • 20 Posts
        Yes.
        Articles add-on is set tu use template "StandardPageTemplate". In this template I call [[!$layout.content]] chunk. The chunk displays few thing like page title and [[!*content]] - which is a article list content.
        In article content I'm using [[!+articles]] to display the list.
        Finnaly in article row template I'm using [[!+tv.HitsPage]]. I've put ! in all calls from root to the leaf, but tv value is still cached somewhere. Even refreshing browser with clear cache.
          • 3749
          • 24,544 Posts
          Is the page itself cached?

          Take a look at the cached version of the resource in core/cache/resource/web/resources/. You may be able to see the TV value there.




            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 46378
            • 20 Posts
            Well, there is file 3.cache.php and a folder [3]. In this folder there are also two php files with random names and few folders 1,2,3... - I guess these are the pages of articles list. So in first folder I've checked files with random names, and there is view counter value inserted into php file, without any call.
              • 3749
              • 24,544 Posts
              It should really contain the tag if the tag is uncached. It's starting to sound like a bug.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 46378
                • 20 Posts
                I've temporarily set "Expiration Time for Partial Resource Cache" to few houres to make this counter refresh from time to time.