We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13473
    • 28 Posts
    Hi I have two template variables setup
    interim_location
    specialism

    I have installed tveditor etc etc. I have the following simple search form.

    <form method="get" action="interim-staff-available-near-you-search-results.htm"><fieldset><legend>Find an Interim Near You</legend>
    <p> [+tve.interim_location:filter->9:label->Your Location:tvtype->dropdown+]</p>
    <p>[+tve.specialism:filter->9:label->Required Specialism:tvtype->dropdown+]</p>

    <p class="submit"><input type="submit" name="search" value="search" class="formInputButton"/></p></fieldset>

    This form works a treat, it populates from the TVlist etc. now when you choose and click search it forwards to my results page.........
    this appears in the bar: http://jamas.co.uk/interim-staff-available-near-you-search-results.htm?interim_location=South%2BWest%2Bof%2BEngland&specialism=Health%2Band%2BSafety&search=search

    So far so good.............

    one the results page is displayed i get no results........

    I use the following for the results page

    [[tvExplorer? &dittoName=`Ditto` &dittoSnippetParameters=`tpl:conssearchresults|parents:39|depth:0|display:all|sortBy:pagetitle|sortDir:ASC` &formTPL=`conssearch`]]

    [+tve.dittoList+]


    Can anyone avise have i missed something.......

    Thanks

    James

      • 11975
      • 2,542 Posts
      Hi,

      to get the values from the form the page must not be cached if your snippet call is [[cached]] or else tvExplorer canot get the datas.

      Hope that helps

      :-)

      EDIT: please note that It’s recommended not to use ’-’ or ’_’ in tv names.
      This could cause weird behavior in tvEditor.

        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 13473
        • 28 Posts
        Hi the call is uncached using the [! and i have renamed the tv taking out the ’_’ still cant get anywhere with it lol

        :-(
          • 13473
          • 28 Posts
          I now have.....
          FORM
          <form method="get" action="interim-staff-available-near-you-search-results.htm"><fieldset><legend>Find an Interim Near You</legend>
          <p> [+tve.interimlocation:filter->9:label->Your Location:tvtype->dropdown+]</p>
          <p>[+tve.specialism:filter->9:label->Required Specialism:tvtype->dropdown+]</p>

          <p class="submit"><input type="submit" name="search" value="Search"  class="formInputButton"/></p></fieldset>

          Snippet call for search:
          [!tvExplorer? &dittoName=`Ditto` &dittoSnippetParameters=`tpl:conssearchresults|sortBy:pagetitle|sortDir:ASC` &filter=`Publishnews,1` &formTPL=`conssearch`!]

          [+tve.searchForm+]


          And Finally Results Page:[!tvExplorer? &dittoName=`Ditto` &dittoSnippetParameters=`tpl:conssearchresults|sortBy:pagetitle|sortDir:ASC` &filter=`Publishnews,1` &formTPL=`conssearch`!]

          [+tve.dittoList+]

          Alas I get nothing I have two dummy pages but it cannot even find those?


          and I get

          Your Search Results

          No documents found.
            • 11975
            • 2,542 Posts
            A simple search without choosing any option value return a list of documents.
            If you can create me an account on your web site I’ll have a look.

            If so send me a PM with credentials

            :-)
              Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
              • 13473
              • 28 Posts
              I do a search using tvexplorer it finds the page but reports the following?

              Warning: htmlspecialchars() expects parameter 1 to be string, array given in /websites/LinuxPackage03/ja/ma/s_/jamas.co.uk/public_html/assets/snippets/ditto/classes/ditto.class.inc.php on line 1030

              Warning: htmlspecialchars() expects parameter 1 to be string, array given in /websites/LinuxPackage03/ja/ma/s_/jamas.co.uk/public_html/assets/snippets/ditto/classes/ditto.class.inc.php on line 1030

              Warning: in_array() [function.in-array]: Wrong datatype for second argument in /websites/LinuxPackage03/ja/ma/s_/jamas.co.uk/public_html/assets/snippets/ditto/extenders/tve.extender.inc.php on line 70

              Warning: htmlspecialchars() expects parameter 1 to be string, array given in /websites/LinuxPackage03/ja/ma/s_/jamas.co.uk/public_html/assets/snippets/ditto/classes/ditto.class.inc.php on line 1030

              Warning: htmlspecialchars() expects parameter 1 to be string, array given in /websites/LinuxPackage03/ja/ma/s_/jamas.co.uk/public_html/assets/snippets/ditto/classes/ditto.class.inc.php on line 1030

              I am at a losss with this now

                • 11975
                • 2,542 Posts
                According the Ditto version you’re using you’ll have to make a little modification to the ditto class.
                You’ll find how to in the tvExplorer thread.

                =>http://modxcms.com/forums/index.php/topic,16456.msg123881.html#msg123881

                :-)
                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 13473
                  • 28 Posts
                  Thanks for that it now works a treat in tv explorer but cannot get my form to work :-(
                    • 11975
                    • 2,542 Posts
                    Now it’s fine.
                    So your issue came from some wrong parameters in the snippet call written in the results page (parents value in this case)
                    Note that I wrote tvexplorer a long time ago but I guess that you cannot write extra filters in the snippet call.
                    I should look at the code to confirm but have no time to do so.
                    So you will not be able to exclude from the result list (if no value is selected) the result page itself.
                    The best is to organize your folders  differently (get out from the folder 8 the result page)

                    :-)
                      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                      • 13473
                      • 28 Posts
                      I dont know what to say. Thank you very very much. smiley smiley smiley smiley