We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18830
    • 161 Posts
    I´ve used PHx very often but today I have a problem that drive me nuts

    [+phx:`[+soldout+]`:is=`[+soldout+]`:then=`some HTML-Code`:else=`[+soldout+]`+]
    


    This seems to be pretty simple - but if you take a closer look this code is wrong. It should go WHEN soldout IS soldout THEN soldout ELSE some HTML-Code

    But in fact it goes WHEN soldout IS soldout THEN some HTML-Code ELSE soldout huh

    I have no idea wht is going wrong, because some PHx-calls work like they should. So I don´t think it´s PHx`fault.

    Does anybody knows what I could do?

      • 7231
      • 4,205 Posts
      I think you have a problem in the syntax. I have little experience using phx: but from what I can remember you need something like
      [+phx:input=`[+placehoder+]`:

      I could be wrong wink
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 34017
        • 898 Posts
        [+soldout+] will always equal [+soldout+]. It’s the same placeholder. You could do if [+soldout+]`:is=`1` or [+soldout+]`:is=`checked`
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
          • 18830
          • 161 Posts
          Quote from: dev_cw at Dec 30, 2008, 05:55 PM

          you need something like
          [+phx:input=`[+placehoder+]`:


          Yes and no: You have to write

          [+phx:if=`[+placehoder+]`:


          I should use my brain again instead of the typing shortcut utility that I installed some days ago.  smiley

          Quote from: ChuckTrukk at Dec 30, 2008, 06:14 PM

          [+soldout+] will always equal [+soldout+]. It’s the same placeholder. You could do if [+soldout+]`:is=`1` or [+soldout+]`:is=`checked`

          I tried this before - without luck. The output of [+soldout+] is "soldout", but using this won´t work. Strange. I must use my wrong code (wrong syntax included) from my first post to get the wanted output.

          I still have trouble with another PHx call. It´s a little bit mor complex but maybe someone is so kind to have a look if this is right.


          [*phx:if=`[[GetField? &docid=`[*phx:get=`termin`*]` &field=`pg_kasse1`  ]]`:is=``:then=`[[GetField? &docid=`[[GetField? &docid=`[*phx:get=`termin`*]` &field=`au_preisgruppe`]]`&field=`pg_kasse1`]]  Euro`:else=``*]
          


          Wenn there is no price at the TV "pg_kasse1" there should be no output but I alway get "Euro" as output instead of nothing. When "pg_kasse1" is set to "8,00" the call will display correctly "8,00 Euro".