We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18913
    • 654 Posts
    Hi,
    I am trying to use NewsPublisher to create a new document that has a Jot call in it’s template. Because Phx is also enabled, I’d like to figure out how to set the cacheable flag on this document to be "uncached." The default for the entire site is cacheable and I don’t want to change that.

    Can anyone tell me how to set this flag on a document that is created "on the fly?" Also, I am using this snippet in release 1.0.0. I know that NewsPublisher was not included because it wasn’t handling template variables (or something like that). However, it seems to suit my simple purpose. If anyone can point out other problems with using this, I’d appreciate feedback.

    Thanks in advance,
    Matt
      • 20413
      • 2,877 Posts
      - Try turn it off for the parent/container and see if the new docs inherit the setting!

      If that doesn’t do it, it’s either adding code for ’cacheable’ into the snippet
      or write a plugin that exclude the docs from being cacheable...

      -------------------------------------------------------------------------
      There is
      &clearcache - when set to 1 the system will automatically clear the site cache after publishing an article.
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 18913
        • 654 Posts
        Thanks! I feel kinda stupid now that you point that out smiley
        Anyway, what I did was add the line that has my initials on it into the NewsPublisher snippet as seen here :
                    // post news content
                    $flds = array(
                        'cacheable'     => '0',  //MattC
                        'pagetitle'     => $title,
        


        And that has at least made the submission uncached. Whether it solves other problems remains to be seen smiley
        Thanks again - I appreciate it.
          • 20413
          • 2,877 Posts
          That is a perfect solution! smiley
            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • 18913
            • 654 Posts
            ... and it will be more perfect when I pick up the cacheable status from the snippet call with an "isset" line of code. But for now, at least Ditto, Jot and PHx seem to be living together peaceably. Now if I can figure out how to allow the moderator to publish/not publish a comment with an email reply ... smiley

            Thanks again for your timely help.
            Matt