We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5382
    • 10 Posts
    Have two custom snippets that set placeholders using $modx->setPlaceholder() as the last step before they return.

    When PHx is enabled, the placeholder setting of one snippet works, and the other ends up empty. No PHx-style changes are being made to the placeholders in the template. Turn PHx off, and both snippets successfully send along their placeholder content.

    Has anyone seen anything like this?
    • Are you caching the page and/or using non-cacheable snippet tags?
      • I’ve had issues with PHx and setting placeholders recently, and I found that having the page uncached and calling the snippet cached worked as intended.

        Not ideal, so would love to find out if someone has digged into this a bit more and found a better solution.
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com
          • 5382
          • 10 Posts
          Greetings,

          Both snippets are being called from all pages. All pages are cached.

          Caching of the two snippets, however, is different. The one where the content was wiped out when PHx was enabled is not cached in its call. The one that continued to work is.

          It wasn’t critical in this instance for the one that was failing to set a placeholder; I changed things to use the returned output and all is fine, but I’d like to be sure I can understand how this works in future projects.