We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20054
    • 21 Posts
    Hey heliotrope, this is a great little snippet!

    One thing though, when I first load the page I have this on, the ditto area is blank. I’d much prefer it to show everything, and then let the user filter... how would I go about that?
      • 11975
      • 2,542 Posts
      Hi,

      you’ll have to change the tvExplorer snippet code round line 467:


      if(isset($tveditor->posted[$prefixID . ’search’])){ //Here

      to


      if(isset($tveditor->posted[$prefixID . ’search’]) || $showRs ){

      And at the beginning around Line 30

      $showRs = (isset($showRs )) ? $showRs : true;


      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 33372
        • 1,611 Posts
        I also did this another way. I only wanted to show search results by default on one page with a tvExplorer form, but not for all of them. So I added this to the top of my snippet:

        if($modx->documentIdentifier==6) $_REQUEST[’search’]=’Search’;

        You could also just add ?search=Search to the URL.
          "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
        • This is a great snippet! It was a bit confusing to setup, is there any page that explains the filter numbers and what they mean? When looking at the filters in ditto pages they only go up to 8, yet I see options here assigned to 9. Is there a list that explains what each filter means?

          Thanks.

          Jose R. Lopez
            • 11975
            • 2,542 Posts
            Hi,

            The filters 1 to 8 are those by default from ditto.
            I’ve added my own 9 and 10.

            9=> works like the "onlytags" if the tv contains at least 1 of the selected value.
            10 => hard to explain, ;-)

            Here is a little explanation about filters in tvexplorer

            TV1: Appellation (checkbox)
            options values: Bordeaux, Côtes du Rhône, Bourgogne, Chateauneuf du pape

            TV2: Couleur (listbox-Multiple)
            options values: Rouge, Rosé, Blanc.

            TV3: Categorie(select)
            options values: Vin de Pays, Vin AOC, Grand crû.


            If we are seraching wines with ChateauNeuf du Pape (AND) Rouge,(AND) Grand crû

            Filters will be:
            F1 : &filter:tvAppellation,ChateauNeuf du Pape,7|tvCouleur,Rouge,7|&Categorie,Grand crû,7
            ou
            F2 :&filter:tvAppellation,ChateauNeuf du Pape,1|tvCouleur,Rouge,1|&Categorie,Grand crû,1
            in both case tagMode is "onlyTags"

            Now we’d like to go further and search the wines:
            ChateauNeuf du Pape OR Bourgogne (AND) Rouge OR Rosé (AND) Grand crû
            Filters F1 et F2 won’t produce satisfying results
            we’ll get wines from ChateauNeuf du Pape OR Bourgogne (OR) Rouge OU Rosé (AND) Grand crû
            we find in the results listings :
            bordeaux rouges grands crus, bordeaux rosés grands crus, Côtes du Rhône rosés grands crus et Côtes du Rhône rouges grands crus althought we were seraching only ChateauNeuf du pape OR Bourgogne.


            tvExplorer will produce additionnal filters to insure a better results list.
            To do so we will exclude from listings documents which have among their Tv values one of the unselected options

            So filters will be
            F1 : &filter:tvAppellation,ChateauNeuf du Pape,7|tvAppellation,Bourgogne,7|tvCouleur,Rouge,7|tvCouleur,Rosé,7|Categorie,Grand crû,7

            OR

            F2 : &filter:tvAppellation,ChateauNeuf du Pape,1|tvAppellation,Bourgogne,1|tvCouleur,Rouge,1|tvCouleur,Rosé,1|Categorie,Grand crû,1

            + filters tvExplorer
            => tvAppellation,Côtes du Rhone,2|tvAppellation,Bordeaux,2|tvCouleur,Blanc,2|Categorie,Vin AOC,2|Categorie,Vin de Pays,2|

            we obtain the expected result:
            Bourgogne wines OR Chateauneuf du pape AND Rouge OR Rosé AND Grand Crû

            :-)

            NOTE that all the filters are passed in an array to ditto
              Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
              • 17062
              • 10 Posts
              hi everyone,

              I’m fairly new to Modx (fan-ta-stic!) and ran into tvExplorer (great!). This extension could make life much easier for me.
              Is there sort of a step by step tutorial or a simple example how to implement this? huh
              I’ve problems in setting up the core code i.e. how do I show the tvexplorer form in the first place..... embarrassed

              thx in advance
                • 11975
                • 2,542 Posts
                Hi,

                there is a sample form and snippet call in the first post.
                Otherwise, post your chunk code and informations about your tvs here and then I will help you

                :-)
                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 17062
                  • 10 Posts
                  thnx for your quick reply, I think something flew into my eye shocked
                  found example, seems to work for me now grin
                    • 20054
                    • 21 Posts
                    hey heliotrope, this is a great little snippet!
                    I’m having a bit of trouble with one bit though - I’m trying to filter on a tv which has a range (FloorSize). I want something basically the same as http://modxcms.com/forums/index.php/topic,16455.msg105063.html#msg105063 so I copied the code you posted and changed it to suit. However as soon as I change the tve.dateElt to tve.FloorSize, one of the sections disappear... This is my chunk at the moment:
                    <form action="[~[*id*]~]"  id="tvExplorer" method="get">
                    <p>
                    [+tve.keywordsSearch:label->Keywords:searchStyle->partial:size->25+]
                    </p>
                    <p>
                    [+tve.Stories:label->Stories:filter->1+]
                    </p>
                    <p>
                          [+tve.FloorSize:name->minFloorSize:source->FloorSize:label->Size between:type->text:filter->3:size->10:maxlength->10+]
                          [+tve.FloorSize:name->maxFloorSize:label->and :source->FloorSize:type->text:filter->4:size->10:maxlength->10+]
                    </p>
                    <p><input id="tve_search" name="search" value="Search" type="submit" /></p>
                    </form>

                    Any ideas what I’m doing wrong?
                      • 11975
                      • 2,542 Posts
                      Hi,

                      You must keep the [+tve.dateElt+]
                      This is a special tag as parentElt.

                      [+tve. dateElt:name->minFloorSize:source->FloorSize:label->Size between:type->text:filter->3:size->10:maxlength->10+]

                      :-)
                        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l