We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9359
    • 128 Posts
    Hi,
    i have a ditto call like this:
    [!Ditto?&parents=`14`&filter=`prodotti-associati-2,[*RICONOSCITORE*],7`!]` and i want that when the output is `No documents found.` no display.
    I have tried this PHx call but not work...
    [+phx:if=`[!Ditto?&parents=`14`&filter=`prodotti-associati-2,[*RICONOSCITORE*],7`!]`:is=`No documents found.`:then=``:else=`......`+]

    Any helps?
    thx
    [ed. note: fabryshock last edited this post 15 years, 1 month ago.]
      "Destiny is not a matter of chance, it's a matter of choice"
      • 33968
      • 863 Posts
      Haven't used Ditto for ages, but I think you can just use &noResults=``
        • 9359
        • 128 Posts
        thanks Lucas, I did not know "&noResult" interesting and very helpful.
        Unfortunately I need to use PHX in this project...
          "Destiny is not a matter of chance, it's a matter of choice"
          • 36416
          • 589 Posts
          Quote from: fabryshock at Sep 02, 2011, 03:40 AM
          I did not know "&noResult" interesting and very helpful.
          Unfortunately I need to use PHX in this project...

          You can put anything inside &noResults parameter - could you better describe problem you're having with it?
            • 9359
            • 128 Posts
            I have to make sure that if I have results I will display a title (<h3> title </h3>) and a list of products, while if the result is 0 should not see anything. The "&noResult" is ok, but I have to put the title only if the condition has occurred ...

            This is my code:


            [+phx:if=`[!Ditto?&parents=`14`&filter=`prodotti-associati-2,[*RICONOSCITORE*],7`&noResults=` `!]`:is=` `:then=``:else=`<h3>{{label-accessori-(yams_id)}}</h3>`+] ---> NOT WORK, EVER DISPLAY THE TITLE

            [!Ditto?&parents=`14`&tpl=`lista-accessori`&filter=`prodotti-associati-2,[*RICONOSCITORE*],7`&extenders=`@FILE assets/modules/yams/yams.extender.inc.php`&id=`(yams_id)` &language=`(yams_mname)`&phx=`0`&noResults=` `!]

            [ed. note: fabryshock last edited this post 15 years, 1 month ago.]
              "Destiny is not a matter of chance, it's a matter of choice"
              • 4310
              • 2,310 Posts
              &tplFirst is your friend.
              Duplicate your lista-accessori tpl and add the <h3> tags and use it as the tplFirst
              If there are no results then nothing is shown, if there are the first result has the <h3> tags, the rest don't
                • 36416
                • 589 Posts
                Quote from: fabryshock at Sep 02, 2011, 04:00 AM
                I have to make sure that if I have results I will display a title (<h3> title </h3>) and a list of products, while if the result is 0 should not see anything. The "&noResult" is ok, but I have to put the title only if the condition has occurred ...

                Ok, how about this:

                [+ditto_iteration:is=`0`:then=`<h3>Section title</h3>`+]
                ...rest of the product template...
                

                  • 9359
                  • 128 Posts
                  Many many thx Eoler and bunk58 , I did not know these commands, very useful!!!!!
                    "Destiny is not a matter of chance, it's a matter of choice"