We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23050
    • 1,842 Posts
    Well huh

    I use 2.0, rev 4, published on 9th Nov. I also use 0.9.5 beta 2

    I don’t know what to say... I don’t even know where to look at. I desactivate PHx and it now works... I tried to play with cache and uncached... nothing.

    I try to disable some plugin I’ve installed to see if it comes from there... but nothing too sad

    The only think I hope is that I didn’t make someting wrong and you look for ... nothing ’cause the fault would be mine ! Please, stop looking at that. If it works on your MODx, I might have made something wrong... I’m gonna catch it !
      • 4195
      • 398 Posts
      One last thing to try.. just to make sure:

      1. Delete the PHx Plugin
      2. Redownload (!) and install PHx (don’t forget about the configuration string)
      3. Try again ...

      I don’t mind hunting a possible bug (even if it turns out to be a user made mistake)
      I want to make sure my own work (in this case PHx) works as promised smiley
        Armand Pondman
        MODx Coding Team
        :: Jot :: PHx
        • 23050
        • 1,842 Posts
        Still the same. Even if I add &phxdebug=Debug;int;0 &phxmaxpass=Max. Passes;int;50 in configuration tab
          • 16892
          • 107 Posts
          i’m trying to do this in a chunk:

          if [+parent+] = `27`, display the [*allProjects*] TV otherwise show the [*allStates*] TV.

          this is my code:

          [+phx:if=`[+parent+]`:is=`27`:then=`[*allProjects*]`:else=`[*allStates*]`+]


          it doesn’t work. how should it be written?

          thanks.
            • 4195
            • 398 Posts
            your code should work... but you could try writing it like

            [+parent:is=`27`:then=`[*allProjects*]`:else=`[*allStates*]`+]
            


            let me know if it works.. otherwise.. give me some more details about which version of MODx, PHx and server setup you are using.
              Armand Pondman
              MODx Coding Team
              :: Jot :: PHx
              • 19726
              • 239 Posts
              is it intended that PHx uses the "Resource path:" setting (under Configuration >> Interface & editor settings) as base for including the PHx classfile?

              I always interpreted that setting as being only for the resourcebrowser in the RTE. I changed the setting to another path, because I don’t want my users to wander around in the assets (sub)folder(s) and I keep the assets folder for system critical stuff like snippets/plugins etc... But because I changed the resourcepath the standard include path that comes with the plugin does not work :-(

              I have currently "fixed" the plugin by hardcoding the path but thats no real solution.
                • 4195
                • 398 Posts
                Quote from: Mitch at Nov 20, 2006, 01:38 PM

                is it intended that PHx uses the "Resource path:" setting (under Configuration >> Interface & editor settings) as base for including the PHx classfile?

                I always interpreted that setting as being only for the resourcebrowser in the RTE. I changed the setting to another path, because I don’t want my users to wander around in the assets (sub)folder(s) and I keep the assets folder for system critical stuff like snippets/plugins etc... But because I changed the resourcepath the standard include path that comes with the plugin does not work :-(

                I have currently "fixed" the plugin by hardcoding the path but thats no real solution.

                Your fix will do fine for now.. i’m going to change the Resource Path variable to the Base Path variable in the next version.
                  Armand Pondman
                  MODx Coding Team
                  :: Jot :: PHx
                  • 23050
                  • 1,842 Posts
                  Hi bS,

                  I’m trying to display month in French in Reflect. In case it wouldn’t be possible, i’m looking for another solution and I think PHx could be my friend.

                  Then, I decided to use :select modifier in Reflect template :

                  $defaultTemplates['month'] = <<<TPL
                  <a href="[+url+]" title="[+month+] [+year+]" class="reflect_month_link">[+month:select=`January=Janvier&November=Novembre`+]</a>
                  TPL;


                  Unfortunately, it doesn’t output anything (even the month in english).
                  Did I make a mistake ? Or can’t PHx be used in such template ?

                  Heliotrope did try to help me with this PHx snippet :
                  <?php
                  
                  $correspondance = array();
                  //vérifier casse du resulats $dateArray['month'] de reflect
                  $correspondance['january'] = "janvier";
                  $correspondance['february'] = "fevrier";
                  //etc ...
                  
                  $moisUK = array_keys($correspondance);
                  $index = array_search($output, $moisUK);
                  
                  return $correspondance[$moisUK[$index]];


                  But same : it doesn’t output anything... that’s why I was wondering if PHx can be used in Reflect template.

                  Thank you wink
                    • 4195
                    • 398 Posts
                    If reflect doesn’t use PHx to render internal templates you have to use a workaround.

                    <a href="[+url+]" title="[+month+] [+year+]" class="reflect_month_link">
                      [+phx:input=`[+month+]`:select=`January=Janvier&November=Novembre`+]
                    </a>
                    


                    Note that PHx has to be active as a plugin for this to work.

                    The phx:input method is explained on the wiki
                      Armand Pondman
                      MODx Coding Team
                      :: Jot :: PHx
                      • 23050
                      • 1,842 Posts
                      Wow!!! Works like a charm wink

                      Thanks bS !

                      This discussion is closed to further replies. Keep calm and carry on.