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

    Is it possible to get the Non Ajax Search (version 1.8.1) to read and display TVs rather than the summary text and titles of documents? Can i add it into the snippet call ? for example if i had TVs called "Product_Name" , "Product_Description" and "Product_Photo" how could i perform the search on these query terms?


    Thanks
      • 36592
      • 970 Posts
      http://wiki.modxcms.com/index.php/AjaxSearch

      I think all the TVs are searched by default.
      You can specify which fields are included in the search with &whereSearch parameter.
      (I myself never tried this, though... )
        • 8168
        • 1,118 Posts
        Thanks - but that does not seem to really help out much as things still not to work...

        Are underscore characters allowed in TV names? Is this why things are not working?

        Can anyone advise the non ajax search string i would need to use to search a selection of TVs and how to reference these TVs in a chunk which the results call using to display content?

        This is my search call

        [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`13` &AS_showResults=`0` &tplLayout =`searchBox` &tvPhx=`tv:displayTV` &whereSearch=`content|tv:Product_Name` !]


        This is the search results display call

        [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`0` &tplResult=`searchResults`!]


        And here is the code for the "searchResults" snippet

        <div id="searchResults" class="searchResults">
        [*as.pagetitle*]
        Product Name: <h4><a href=[~[+as.id+]~] title="Find out more about [+as.Product_Name+]">[+as.Product_Name+]</a></h4>
        Product Description: <p>[+as.Product_Description+]</p>
        Product Thumb: <a href=[~[+as.id+]~] title="[+as.Product_Name+]"><img src="[+as.Product_Photo_Thumb+]" border="0"  alt="Find out more about  [+as.Product_Name+]" title="Find out more about  [+as.Product_Name+]"/></a>
        Find out more link: <p><a href=[~[+as.id+]~] title="Find out more about [+as.Product_Name+]">Find out more about [+as.Product_Name+]</a></p>
        <hr />
        </div>



        What currently happens is the search works, and pulls up the results, but the TV data is not rendered on screen.... Any ideas why?

        Thanks so much!