We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30741
    • 65 Posts
    Hey Guys,
    I am brand new to MODx - Not to web design world or PHP / Java / Css / Etc. though.
    And I must say I am very interested in this CMS. I think that I can be up to speed in the next 5-6 hours, and republish a site, by the end of the weekend. Which is absolutely amazing to me. It seems to offer a lot of solutions where CMS fall short in my opinion.

    But enough on that, I have a couple of questions about PHx - And perhaps a few more examples / demos would help if any one can point me in the correct direction.

    But for now on the Wiki I plugged in the :love
    But when I call it [+phx:love+]
    I get this result - &_PHX_INTERNAL_& because I love MODx

    Debug I get =
    51 [13:33:41] MODx / PHx placeholder variable: phx
    52 [13:33:41] |--- Input = ’&_PHX_INTERNAL_&’
    53 [13:33:41] |--- Modifier = ’love’
    54 [13:33:41] |--- DB -> Custom Modifier
    55 [13:33:41] |--- Output = ’&_PHX_INTERNAL_& because I love MODx’

    But if I take out phx call, then I get nothing.
    So can anyone help me out here.
      • 27708 MODX Staff
      • 2,502 Posts
      Are you trying to learn how to create a Custom Modifier? If so look at the other user contributed custom modifiers here: http://wiki.modxcms.com/index.php/PHx/CustomModifiers

      If you have more questions, please let us know.
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 30741
        • 65 Posts
        Thanks for your reply, and seeing the custom modifiers is great. But the issue is
        when I enter [+phx:love+] as in the example on the wiki I get - &_PHX_INTERNAL_& because I love MODx

        See here on the wiki -
        http://wiki.modxcms.com/index.php/PHx

        So I don’t get it what am I doing wrong?
          • 20413
          • 2,877 Posts
          1) Check double php tag endings in custom modifier?

          2) If no PHx works
          Try changing the plugin to use this line instead:
          include_once $modx->config['base_path'] . "assets/plugins/phx/phx.parser.class.inc.php";

          And make sure that folder is uploaded correct
            @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
            • 30741
            • 65 Posts
            I’m not sure. But it looks correct. >:(
              • 22303 MODX Staff
              • 10,725 Posts
              You’ll want to apply the custom :love modifier (implemented in the phx:love snippet you created) to an actual variable, not as [+phx:love+]. IOW, something like this would append the string to your pagetitle:
              [*pagetitle:love*]

              The string ’phx’ is, as your output indicates, an internal mechanism of PHx, and meaningless as a placeholder in this case.
                • 30741
                • 65 Posts
                Cool that works. Thanks! I get it now.
                I was using [++] instead of [**]
                So for whatever reason [**] works fine for me.
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Quote from: tspore at May 10, 2009, 08:25 AM

                  I was using [++] instead of [**]
                  So for whatever reason [**] works fine for me.
                  It does work with placeholders, i.e. [++], as well as content/TV tags, i.e. [**], but you would have to use it with a placeholder besides [+phx+] since phx is not really a placeholder. If you had code in a snippet somewhere like this:
                  $modx->setPlaceholder('foo', 'I eat worms');

                  Then you could use:
                  [+foo:love+]