We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30504
    • 14 Posts
    I have some problem with PHx (2.1.2). I use chunk which contains a Ditto call inside followed by plcaeholder [+totalpages+]. The chunk looks like:
    [!Ditto? ......parameters..... !]
    Total pages: [+totalpages+]
    

    Everything was OK untill I’ve installed PHx. After that placeholder [+totalpages+] become empty. And after I switched off PHx all placeholders became work again. I tried to use other Ditto placeholders, but it seems to me, that PHx ’eats’ them all. Am I doing something wrong? How can I preserve my placeholders from being erased by PHx?
    PHx is very comfortable in use and I don’t want to uninstall it... Any suggestions?
      • 30504
      • 14 Posts
      I’ve found that PHx cleans some placeholders... here’s a piece of it’s code:
      // clean up unused placeholders that have modifiers attached (MODx can't clean them)
      preg_match_all('~\[(\+|\*|\()([^:\+\[\]]+)([^\[\]]*?)(\1|\))\]~s', $template, $matches);
      if ($matches[0]) {
           $template = str_replace($matches[0], '', $template);
           $this->Log("Cleaning unsolved tags: \n" . implode("\n",$matches[2]) );
      }
      

      I haven’t much time to get a load of what’s it for, but when I removed this piece of code no more placeholders was erased by PHx and everything seems to be ok.