We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8770
    • 21 Posts
    i’m having some problems with the FlexSearchForm snippet. i have a small search box in the header of my page and i don’t want the results to list up there. i call it like this:

    [[FlexSearchForm?FSF_landing=31&FSF_showResults=0]]


    In My template, I took the search form at the top of the page and put this in the body of the page:

    [!FlexSearchForm?FSF_landing=31&FSF_showResults=1&FSF_showForm=1!]


    That’s pretty much all i have in the template. Finally, in my landing page, I have this:

    [!FlexSearchForm!]


    However, when I do a search, i get this:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: Invalid argument supplied for foreach()
    Error type/ Nr.: Warning - 2
    File: /htdocs/st/manager/includes/document.parser.class.inc.php(705) : eval()’d code
    Line: 690

    What am I doing wrong????

    Thanks,
    mike
      • 22815
      • 1,097 Posts
      At a guess, your landing page is trying to generate the results twice - once in the template and once in the content area.

      Try this:

      Have the small search box in the template.
      Take out the second call from the template.
      Replace the third call with the second call in the content of the landing page.
        No, I don't know what OpenGeek's saying half the time either.
        MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
        Forum: Where to post threads about add-ons | Forum Rules
        Like MODx? donate (and/or share your resources)
        Like me? See my Amazon wishlist
        MODx "Most Promising CMS" - so appropriate!
        • 8770
        • 21 Posts
        Thanks for your reply.

        I removed the second call and placed it into the third, but i’m still getting the error. i even refreshed the site and i’m still getting the error:

        « MODx Parse Error »
        MODx encountered the following error while attempting to parse the requested resource:
        « PHP Parse Error »

        PHP error debug
        Error: Invalid argument supplied for foreach()
        Error type/ Nr.: Warning - 2
        File: /htdocs/st/manager/includes/document.parser.class.inc.php(705) : eval()’d code
        Line: 690
          • 8770
          • 21 Posts
          Hey, I’m still having this problem. If anyone can point me in the right direction, I’d really appreciate it.

          Thanks
            • 7923
            • 4,213 Posts
            What version of FlexSearchForm are you using? I checked the one that comes with default install and it doesn’t have anywhere near 690 lines, so I guess that your error is coming from some other snippet.. (that has over 690 lines).


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 8770
              • 21 Posts
              shit. you were right, i had forgotten that i copied in the snippet HyperFlexSearchForm. i copied back the code for FlexSearchForm and it works. undecided

              Thanks!