We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    Quote from: ncrossland at Jun 27, 2007, 04:15 AM

    Quote from: rthrash at Jun 25, 2007, 08:27 AM

    Armand is very busy being a dad for the first time. I don’t think anyone would object, and personally think it’s a great idea. smiley

    Understandable then!! I’ll tidy up the files and upload them to the repository.


    Did you also include the hack: http://modxcms.com/forums/index.php/topic,14306.msg96738.html#msg96738

    so that placeholders used in snippetcalls are not removed by phx?
      follow me on twitter: @dimmy01
      • 21056
      • 327 Posts
      Quote from: Dimmy at Jun 27, 2007, 04:24 AM

      Quote from: ncrossland at Jun 27, 2007, 04:15 AM

      Quote from: rthrash at Jun 25, 2007, 08:27 AM

      Armand is very busy being a dad for the first time. I don’t think anyone would object, and personally think it’s a great idea. smiley

      Understandable then!! I’ll tidy up the files and upload them to the repository.


      Did you also include the hack: http://modxcms.com/forums/index.php/topic,14306.msg96738.html#msg96738

      so that placeholders used in snippetcalls are not removed by phx?

      Didn’t know about that, but I will merge it in before I upload.
        Author: ManagerManager plugin - customise your ModX manager interface

        Rckt - web development, Sheffield, UK
        • 4195
        • 398 Posts
        FYI: using the hack will result in PHX not being recursive.
        The reason phx takes on the placeholders is because it needs to resolve the value when they are nested.
          Armand Pondman
          MODx Coding Team
          :: Jot :: PHx
          • 7455
          • 2,204 Posts
          Hello bs nice to see you back here, how is it at home? all good with the baby? an being a dad? I will be dad for the 2nd time soon (the end date was today so it can happen any day now)

          back to PHx, could PHx just place the placeholder back if no phx additions are found on the placeholder? so if there is no :anyphxthing= in the placeholder do not touch it.

          I use PHx alot but I also use eForm alot and even togetter like this:
          [+betalingsmethode:is=`Ideal`:then=` [!eForm? &eFormOnBeforeMailSent=`eForm2db` &allowhtml=`1` &formid=`kassaform` &to=`[+email+]`&from=`[email protected]` &fromname=`MiN Website` &bcc=`[email protected]` &replyto=`[email protected] `&tpl=`kassaform` &language=`nederlands`&report=`kassareport` &thankyou=`idealsubmit` &subject=`Bestelling vanaf de MiN site`!] [!order_sessie!]`:else=`[!eForm? &eFormOnBeforeMailSent=`eForm2db` &allowhtml=`1` &formid=`kassaform` &to=`[+email+]`&from=`[email protected]` &fromname=`MiN Website` &bcc=`[email protected]` &replyto=`[email protected]`&tpl=`kassaform` &language=`nederlands`&report=`kassareport` &gotoid=`60` &subject=`Bestelling vanaf de MiN site`!] [!order_sessie!]`+] 
          


          mm thinking of the above code does leave the placeholders in place but the next call is stripped of the tags

          [!eForm? &debug=`1` &formid=`persfriendform` &to=`[+uwemail+]`&bcc=`[+email+]` &from=`[+uwemail+]` &replyto=`[+uwemail+]` &tpl=`persfriendform` &language=`nederlands` &report=`persfriendreport` &thankyou=`vriendverstuurd` &subject=`[+naam+] wil graag dat u even kijkt...`!]
          
            follow me on twitter: @dimmy01
            • 4195
            • 398 Posts
            it should leave the unresolved ones intact (if they have NO modifiers). The ones with modifiers that are unresolved are cleared by PHx the ones without it just leaves for MODx. It’s been a while since i write the code but I know i have spent many nights solving the parser problems. Maybe it’s time for a short review later this week to help you guys out smiley
              Armand Pondman
              MODx Coding Team
              :: Jot :: PHx
              • 1888
              • 9 Posts
              I have a problem wth phx. I am using an expression like :
              [+phx:if=`[+placeholder+]`:ne=``:then=`[+placeholder+]`:else=``+]
              The problem is that if the string which replaces placeholder is above 8600 or so characters, i get the entire phx statement in the output with the placeholder being replaced both times.

              How can i fix or work around this?
                • 4195
                • 398 Posts
                can you send me the complete output so i can reproduce?
                  Armand Pondman
                  MODx Coding Team
                  :: Jot :: PHx
                  • 1888
                  • 9 Posts
                  Okay, the output looks like this test page I made:
                  http://cehd.gmu.edu/test5/

                  I have uploaded my chunk and snippet -
                  This is the chunk: http://www.box.net/shared/rf8br7luup
                  This is the snippet: http://www.box.net/shared/2tt54lbgdn

                  The call to the snippet is a non-cacheable call [!snippet!] and caching for the page where call is implemented is turned off too.

                  The number on the test page is the length of characters of the string which replaces placeholder, which i have found by trial and error to be the treshold in my case (16615). Strangely, it also seems to depend on the size of my chunk, because if I reduce the size of any string in my chunk, it seems to work as expected. It doesnt depend on the placeholder though ([+this+] is as good as [+placeholder+]). The length of the chunk without the placeholder is 108 characters.

                  There is one more weirder problem -

                  If chunk is like this (in one line):

                  [+phx:if=`[+placeholder+]`:ne=``:then=`<div id="publications"><h2>Recent Publications He</h2><div>[+placeholder+]</div></div>`:else=`PE`+]

                  then i get a blank page as output.

                  But if chunk is like this (a newline after <\div> with two characters removed from the header to compensate for \n and maintain limit threshold):

                  [+phx:if=`[+placeholder+]`:ne=``:then=`<div id="publications"><h2>Recent Publications </h2><div>[+placeholder+]</div>
                  </div>`:else=`PE`+]

                  then i get the "[+phx...." in the output with both instances of [+placeholder+] replaced.
                    • 19033
                    • 892 Posts
                    Dear all,
                    and I thank to your great work, PHx.

                    I have two troubles by Jot and PHx.
                    One contributed to the forum of jot.
                    Please refer to it:
                    http://modxcms.com/forums/index.php/topic,12828.msg103702.html#msg103702

                    But when I found another problem, it seems that it is trouble of PHx, I think.
                    So I contribute this forum.

                    About version:
                    MODx 0.9.5
                    PHx 2.1.2
                    Jot 1.1.2

                    I tried the following:
                    1. create a chunk, for example. Name is "forluluminitest".
                    [[Jot? &docid=`287` &validate=`content:content required,title:title requred:#[abc]#`]]


                    2. create a template and write as following.
                    ......
                    {{forluluminitest}}
                    [+jot.html.comments+]
                    [+jot.html.navigation+]
                    [+jot.html.form+]
                    ......


                    3. create a document and select the template which created in the above. And save.
                    4. access url of document which create in the above.
                    5. comment form appears.
                    6. input the required fields. And click button of "submit".
                    7. Then I get an error as following.
                      Error: 	preg_match() [function.preg-match]: Empty regular expression	 
                      Error type/ Nr.: 	Warning - 2	 
                      File: 	/home/example/www/assets/snippets/jot/jot.class.inc.php	 
                      Line: 	781	 
                      Line 781 source: 	if (!preg_match($re,$value))


                    NEXT:
                    1. Disable PHx.
                    2. Try again.
                    3. I do not get error. The contribution of comment is successful.

                    NEXT:
                    1. Run PHx.
                    2. rewrite the chunk as following.
                    [[Jot?  &docid=`287` &validate=`content:content required,title:title requred:#abc#`]]

                    (Of course, the meaning of Regular expression would differ).

                    3. Try again.
                    4. I do not get error.

                    I would like to use Regular expression (for example, #[abc]#) in Jot.
                    But it is disabled, if PHx is able.

                    Can I solve this problem?

                    Sincerely yours,
                      • 21257 MODX Staff
                      • 730 Posts
                      Hi,
                      PHx is prohibiting me from specifying a Chunk name with a TV.
                      ex. {{[*right-hand-images*]}}
                      I have looked through this thread, and while it feels similar to the problem people are having specifying an address in the eForm snippet, I tried TobyL’s mod http://modxcms.com/forums/index.php/topic,14306.msg96738.html#msg96738, and it did not do the trick.
                      Is this being worked on, or has been solved elsewhere?
                      Kind regards,
                      Mike

                        Mike Schell
                        Lead Developer, MODX Cloud
                        Email: [email protected]
                        GitHub: https://github.com/netProphET/
                        Twitter: @mkschell

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