We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11975
    • 2,542 Posts
    Hi,

    if you don’t use the PHx plugin call tvexplore [! uncached.
    If you’re using PHx uncache the page .


    :-)
      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
      • 24425
      • 12 Posts
      Bit of a noob question, but do I need to use a form to submit values to tvExplorer? I would really like to have some pre-defined searches setup on certain pages...

      thanks!
      R
        • 33372
        • 1,611 Posts
        You can set values in the query string of the URL or you can use a snippet called before tvExplorer to set them.
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 26179
          • 21 Posts
          Hi, I’m trying to let tvExplorer work on my site, but I think I need some help.
          I have some documents with tv (text) to show the author of the article. All I want is to have a dropdown list of all these authors in order to search all articles written by xxx.
          I prepared a tv "lista_autori" (dropdown list menu) to select all authors with
          @SELECT DISTINCT `value` FROM `tmplvar_contentvalues` WHERE `tmplvarid` =19

          on my search doc
          [!tvExplorer? &dittoSnippetParameters=`parents:413|tpl:risultati_ricerca|dateSource:pub_date|dateFormat:%B %e, %Y|sortBy:pub_date` &dittoName=`Ditto` &formTPL=`tveForm`!]
          [+tve.searchForm+]
          [+tve.dittoList+]

          "tveForm" chuck
           <form action="[~[*id*]~]" method="get"> 
          [+tve.lista_autori:label->Seleziona un autore+]
          <input type="submit" name="tve_search" value="Search" />
          </form>

          "risultati_ricerca" chunk
          <div class="ditto_item" id="ditto_item_[+id+]">  <h3 class="ditto_pageTitle"><a href="[~[+id+]~]">[+pagetitle+]</a></h3> <div class="ditto_introText">[+introtext+]</div>  </div>


          As I don’t use the PHx I called tvexplorer [! while the page is cached.

          Running my search page I find this source code
          <form action="cerca-test.html" method="get"> 
          
          <label class=" select " for="lista_autori" > Seleziona un autore</label>
          <select id="lista_autori"  name="lista_autori" >
          <option value=""  ></option><option value="Luigi"  >Luigi</option><option value="Samantha"  >Samantha</option>
          </select>
          
          <input type="submit" name="tve_search" value="Search" />
          </form>

          All I have is the real list of all authors but if I try to search I don’t have result.
          Where I’m wrong huh huh

          Thanks
          Sara
            • 11975
            • 2,542 Posts
            Hi,

            according to me the issue comes from the name of the submit.
            In its current version tvx is activated by the input name.
            By default the name must be "search".
            If you use the id params then you  have to add the id as a prefix to the input name.

            In you case, remove the "tve_" prefix
            <input type="submit" name="tve_search" value="Search" />

            IE can be buggy with this so if you want you can use an hidden input to pass the "search"
            <input type="hidden" name="search" value="1" />

            and then change the submit name to what you want.

            :-)

              Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
              • 26179
              • 21 Posts
              Thanks for your reply!
              Removing the "tve_" it works and shows the results but...... results are wrong !
              For example:
              I have 2 authors: Luigi (2 articles) and Samantha (1 article)
              If I search for Luigi’s articles I have all 3 documents including also Samantha’s one. :’(
                • 11975
                • 2,542 Posts
                You can enable the ditto debug to view the filters created by tvexplorer.

                If you have only one author per article,change your tag
                [+tve.lista_autori:label->Seleziona un autore:filter->1+]

                :-)


                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 3707
                  • 241 Posts
                  Hi Helio, this is some fantastic work you’ve done with tvExplorer and tvEditor, a great addition to MODx. I do have a couple of questions though.

                  Firstly, regarding the filter parameter, in the Ditto documentation there seems to be two mode lists. On this page http://ditto.modxcms.com/tutorials/basic_filtering.html you have 8 modes but on this page http://ditto.modxcms.com/files/snippet-ditto-php.html#filter there are 3 extra modes:
                  9 -> case insenstive version of #7;
                  10 -> case insenstive version of #8;
                  11 -> checks leading character of the field.

                  I don’t know if the Ditto documentation is just out of date but I would like to use mode 9 in a text field search for case insensitive string matching. Since you have added your own mode 9, this option doesn’t work. Is there a way to change the case sensitivity on a text search or to have these modes incorporated?

                  Secondly, is the fullText parameter working and if so, what is the correct syntax for using it? I tried fullText->true, fullText->false, fullText->1 and fullText->0 but they all seem to produce the same results.

                  I tried the fullText parameter hoping it would solve the case sensitivity problem I was having and it worked but it works whatever I set the value to! Also, when I added the fullText parameter, it printed the SQL statement to the page. I commented out line 328 (echo $debugSQL;) in the tvExplorer snippet to stop the SQL being printed to the page if that’s the right thing to do.
                    • 11975
                    • 2,542 Posts
                    Hi,

                    first of all thanks for your kind comments.

                    About filters, you’ll find more about how they work in tvExplorer
                    http://modxcms.com/forums/index.php/topic,16456.msg122338.html#msg122338

                    I didn’t know that mark had added 3 new filters.
                    I have also created two  new filters which numbers are 9 and 10, so I don’t know if mine or the ditto filters are applied.
                    I haven’t tested yet tvExplorer with ditto 2.1.

                    I’m currrently trying to release a new version but time is missing.

                    :-)
                      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                      • 3707
                      • 241 Posts
                      I thought I was using an earlier version of Ditto but I just checked and it is 2.1. It could explain why the fullText parameter isn’t working for me. Although it did fix my problem and my search form is working perfectly so I’m happy for now : )

                      From the testing I’ve done, I’d say your version of filter 9 is being applied. I look forward to the next version if you can find some of that precious time!