We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3707
    • 241 Posts
    Yes, the ID is the number in brackets in the document tree and they don’t have to shown in menu. Did you create the two product pages as children of another document or in the root of the tree? If they are child docs, use the ID of the parent. If they are root docs use 0 as the ID.

    It looks like the search is working it’s just not finding the documents to search.
      • 22574
      • 181 Posts
      Thanks Bob but that didn’t work either?

      I now have
      [[tvExplorer? &dittoName=`Ditto` &dittoSnippetParameters=`tpl:resultsTpl|parents:0|depth:0|display:all|sortBy:pagetitle|sortDir:ASC` &formTPL=`searchTpl`]]
      [+tve.searchForm+][+tve.dittoList+]


      If I go into tvExplorer within modx it works fine, I choose an option from a drop down box and it finds the correct page/s/.

      There must be a stupid mistake that I am making somewhere.

        • 3707
        • 241 Posts
        OK, first check to see if your Ditto parameters are returning the right results. Place a Ditto call on your page with the same parameters as the tvExplorer call.
        [[Ditto? &parents=`0` &depth=`0` &tpl=`resultsTpl` &display=`all` &sortBy=`pagetitle` &sortDir=`ASC`]]

        If that doesn’t produce the results you want, you’ll need to change the parameters until it works and then copy those parameters to tvExplorer.

        I also noticed that you use tvtype->dropdown in your form template. Try using tvtype->select instead.

        Are your pages cached? If they are, try calling tvExplorer uncached [!tvExplorer? ...!]
          • 22574
          • 181 Posts
          Thanks Bob,

          That ditto line worked.

          I changed the lists to ’select’ as well.

          But still no results with the tvExplorer snippet?

          My thoughts are that if the ditto line is working then the resultsTpl is working so it must be the tvExplorer snippet or the search form yeah?!

          <form action= " [~[*id*]~] “method= "get” >
                      <table width="100%" border="0" cellspacing="0" cellpadding="0">
          			  <tr>
          				<td colspan="2"></td>
          			  </tr>
          			  <tr>
          				<td class="searchFeild"><b>Make / Model:</b></td>
          				<td class="searchFeild">
                          [+tve.model:filter->9:label->:tvtype->select+]
          			    </td>
          				</tr>
          				<tr>
          				<td class="searchFeild"><b>Year:</b></td>
          				<td class="searchFeild">
          				[+tve.year:filter->9:label->:tvtype->select+]</td>
          				</tr>
                          <tr>
          				<td class="searchFeild"><b>Part Number:</b></td>
          				<td class="searchFeild">
          				[+tve.partNo:filter->9:label->:tvtype->text+]</td>
          				</tr>
          				<td> 
          				</td>
          				<td>
          				<input type="submit" name="search" value="Search" /></td>
          				</tr>
          			  </table>
          			  </form> 
            • 22574
            • 181 Posts
            Also what do the snippets
            [+tve.searchForm+][+tve.dittoList+]

            do?

            Should there be chunks for searchForm and dittoList or are they called in the tvExplorer chunk?

            Cheers
              • 7231
              • 4,205 Posts
              Those are placeholders, not snippets. Place the search form place folder where you want te search form to show in your template and the ditto list where you want the results to show.
                [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                Something is happening here, but you don&#39;t know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 3707
                • 241 Posts
                I managed to get this working on my test server. This is my document tree:

                Products [11]
                -Item 1 [13]
                -Item 2 [14]
                -Item 3 [15]
                Product search [12]

                Items 1-3 are my product pages, these are set to be published. They have the following TVs assigned:

                [*model*]
                Input Type: DropDown List Menu
                Input Option Values: ||xyz123||xyz456||xyz789 etc.

                [*partNo*]
                Input Type: Text

                [*prod-year*]
                Input Type: DropDown List Menu
                Input Option Values: ||2000||2001||2002 etc.

                The first option in the list is set to be blank and I changed [*year*] to [*prod-year*] because [*year*] conflicted with something.

                Product search contains the tvExplorer call and the document is set to be uncached.
                [[tvExplorer? &dittoName=`Ditto` &dittoSnippetParameters=`tpl:resultsTpl|parents:11|depth:0|display:all|sortBy:pagetitle|sortDir:ASC|showPublishedOnly:0` &formTPL=`searchTpl`]]
                [+tve.searchForm+][+tve.dittoList+]

                The Ditto parents parameter is set as 11 because this is the parent document of my product pages.

                The resultsTpl is:
                <h4><a href="[~[+id+]~]">[+title+]</a></h4>
                <p>[+partNo+] - [+model+] - [+prod-year+]</p>

                The searchTpl is:
                <form action= "[~[*id*]~]" method= "get" >
                <table width="200" border="0" cellspacing="0" cellpadding="0">
                <tr><td colspan="2"></td></tr>
                <tr>
                <td class="searchFeild"><b>Make / Model:</b></td>
                <td class="searchFeild">[+tve.model:filter->9:label->:tvtype->select:blankLabel->- Please choose -+]</td>
                </tr>
                <tr>
                <td class="searchFeild"><b>Year:</b></td>
                <td class="searchFeild">[+tve.prod-year:filter->9:label->:tvtype->select:blankLabel->- Please choose -+]</td>
                </tr>
                <tr>
                <td class="searchFeild"><b>Part Number:</b></td>
                <td class="searchFeild">[+tve.partNo:fullText->true:filter->7:includeTVs->partNo:label->:tvtype->text+]</td>
                </tr>
                <td> </td>
                <td><input type="submit" name="search" value="Search" /></td>
                </tr>
                </table>
                </form> 

                For the Part number form field I used fullText->true to allow partial string matches.

                Try replacing your code with my examples remembering to change parents:11 to the ID of your parent document. Change the name of the [*year*] TV and make sure that the product pages are published and the search page is uncached.
                  • 26931
                  • 2,314 Posts
                  Hi Bob,

                  wow, this is amazing! i followd your little tutorial, and it’s working! smiley this is great! and what a great modul/tool!
                  i’ve got one question though, when i search for the TV "partNo", (TV set to text), the document will be found and schown, but above the search form this message appears:
                  SELECT DISTINCT sc.id, sc.pagetitle, sc.longtitle, sc.introtext, 
                  sc.description, sc.content FROM `modxtest`.modx_site_content sc LEFT JOIN `modxtest`.modx_site_tmplvar_contentvalues stc ON sc.id = stc.contentid WHERE 
                  (stc.value LIKE '%auto%') AND sc.privateweb = 0 AND sc.published = 1 AND sc.searchable=1 AND sc.deleted=0 AND sc.parent IN (48) AND stc.tmplvarid=5
                  can you tell me what that is about?
                  thank you & best regards, j
                    • 11975
                    • 2,542 Posts
                    Hi,

                    I guess I have forgotten an echo or a print in the snippet code.
                    Copy and paste the snippet code in a text editor,serach for echo / print and then delete the line containing it

                    :-)
                      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                      • 26931
                      • 2,314 Posts
                      Hi heliotrope,

                      thank you for your quick reply! unfortunately, i found no
                      search / print
                      in the tvExplorer-Snippet

                      best regards, j

                      btw, i’m using this tvEditor.0.8.5.2 (-> is this the most recent one?) on 0.9.6.1p2.