We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31088
    • 14 Posts
    Hi
    can’t seem to make this work:
    [*random-content-tag:isnot=`0`:then=`[*random-content-tag-2*]`*]

    Works like a charm in Ditto calls - eg: [+stuff+] - but it almost seems like PHX doesn’t work with content tags...?

    I’ve tried this with template vars, content placeholders, and combinations thereof.
    I have a phx snippet called isnotempty, which I call like:
    [*stuff:isnotempty:then=`[*stuff*]`*]

    but again it only works with Ditto calls.

    so am I daft? have I missed something really bleeding obvious?

    thanx for any suggestions.

    -g
    ps:
    I thought maybe going through these contortions might help...
    [!showDate:isnot=`1`:then=``!][!showDate:is=`1`:then=`<small>[*publishedon:strtotime:date=`%b %d %Y`*]</small>`:else=` `!]

    Notice the uncached everything, my last ditch attempt... at least it stopped showing all my ]*]] stuff. smiley haha
      • 16278
      • 928 Posts
      have I missed something really bleeding obvious?
      This justifies a basic question, I hope: Is it plugged in? (One of the two basic helpdesk questions, closely followed by "is it switched on?". These sort out an amazingly large proportion of problems.) In this context, have you installed the PHx plugin? Ditto uses its own copy of PHx, and applies it in its template chunks. If you want to use PHx on the main content areas, you need to install it as a plugin in its own right.
      grin KP
        • 31088
        • 14 Posts
        laugh hah!
        oh thank you, I seem to have misunderstood when someone said, "you don’t need to install PHX anymore"!
        They were talking about for Ditto, not for normal operations!

        That’s awesome.

        Thanks again
        -G
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Or they may have been referring to Revo, which has phx functionality built-in.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 31088
            • 14 Posts
            Yeah, that’s possible actually. I have to make the jump I think.

            I wonder how tough it will be to move my freshly built CMS structure over to Revo...?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              I see no need for it. But then I never use the phx plugin. A snippet does the job just as well without the extra weight of a plugin. As an addition to a snippet for using in the snippet’s tpl is another matter. Ditto and Jot do very well with it.

              The phx plugin is buggy anyway; it eats everybody else’s placeholders. I suspect the regular expression in its garbage collection is bad but I don’t get along well enough with regex to see where the problem is. If it can detect its own placeholders to process, it should certainly be able to detect them for removal.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 26931
                • 2,314 Posts
                The phx plugin is buggy anyway; it eats everybody else’s placeholders. I suspect the regular expression in its garbage collection is bad but I don’t get along well enough with regex to see where the problem is. If it can detect its own placeholders to process, it should certainly be able to detect them for removal.
                i stopped using PHX outside of Ditto & MaxiGallery, too, but as far as i remember, there’s an updated version floating around somewhere ...i’ll search for it later