We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5948
    • 32 Posts
    Hi,

    I am building a feature into MODx for my works intranet that picks up email from a pop account and creates a page for each email so we can comment etc on each post on the homepage. I am using the docmanager class (http://modxcms.com/forums/index.php/topic,5983.msg42409.html#msg42409) and after creating all my pages I run $modx->clearCache however...

    The pages are not appearing on the frontend until I do something in the manager that clears the cache. So my thinking is that its clearing the cache but not rebuilding it? I know that my script has access to the $modx object so I knoe its not that[first thing I checked wink]

    Any idea?
      • 4041
      • 788 Posts
      Looking in the save_content.processor.php & the newspublisher snippet, both use the following to redo the cache, maybe you can integrate this into your setup or make it a standlaone snippet and call it that way.
      <?php
      // taken from newspublisher snippet
      
      if ($syncsite == 1) {
              // empty cache
              include_once $modx->config['base_path']."manager/processors/cache_sync.class.processor.php";
              $sync = new synccache();
              $sync->setCachepath("assets/cache/");
              $sync->setReport(false);
              $sync->emptyCache();
      }
      ?>
        xforum
        http://frsbuilders.net (under construction) forum for evolution