We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11316
    • 81 Posts
    Hopefully someone can help me out with this. Everytime I try to define my tv value as where to search I get the following error.

    Here is the Search call:
    [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`112` &grabMax=`10` &highlightResult=`0` &whereSearch=`content:pagetitle,introtext|tv:sidebarRight` &extract=`1:sidebarRight` &tplLayout=`optionSearch` &withTvs=`-:subNavImage,leftboxTop,leftboxMid,leftboxBot` &hideMenu=`0`!]

    Also where do I configure to not truncate the returned text - seems to only grab about 5 words in the extraction but I would like to grab all the info or 2 sentences.

    Any help would be greatly appreciated!

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »

    PHP error debug
    Error: implode() [function.implode]: Invalid arguments passed
    Error type/ Nr.: Warning - 2
    File: /home1/perspec9/public_html/build/assets/snippets/ajaxSearch/classes/search.class.inc.php
    Line: 526
    Line 526 source: $whereSubClause = implode($whereOper,$whsc);

    Parser timing
    MySQL: 0.0027 s (5 Requests)
    PHP: 0.0572 s
    Total: 0.0599 s
      • 5811
      • 1,717 Posts
      [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`112` &grabMax=`10` &highlightResult=`0` &whereSearch=`content:pagetitle,introtext|tv:sidebarRight` &extract=`1:sidebarRight` &tplLayout=`optionSearch` &withTvs=`-:subNavImage,leftboxTop,leftboxMid,leftboxBot` &hideMenu=`0`!]

      Try this:

      [!AjaxSearch? &ajaxSearch=`0` &AS_landing=`112` &grabMax=`10` &highlightResult=`0` &whereSearch=`content:pagetitle,introtext|tv` &tplLayout=`optionSearch` &withTvs=`-:subNavImage,leftboxTop,leftboxMid,leftboxBot` &hideMenu=`0`!]
      tv:sidebarRight isn’t correct as sidebarRight is not a valid field. The only valid field for tv is tv_value, which is also the default. So the token "tv" is enought.

      for the same reason &extract=`1:sidebarRight` is not correct.
      If you would like display the tv content use the following placeholders in your result template:

      [+as.tv_value], [+as.tv_valueShow+], [+as.tv_valueClass+]

      See from the line 929 to 955 of the ajaxSearch.readme.txt file.
        • 11316
        • 81 Posts
        Thank you so much for this reply, as per your instructions. It is returning the correct information. Does the truncation only happen in the summary text? I noticed that when I use this tv_value it’s returning all the data (which is wonderful!) just curious.

        <div class="[+as.resultClass+]">
        <h3><a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.pagetitle+]">[+as.pagetitle+]</a></h3>
        <p><a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.pagetitle+]">[(site_url)][+as.resultLink+]</a></p>
        [+as.extractShow:is=`1`:then=`
        <div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
        `+]
        (( I added this ))
        [+as.tv_valueShow:is=`1`:then=`
        <div class="[+as.tv_valueClass+]"><p>[+as.tv_value+]</p></div>
        `+]

        [+as.breadcrumbsShow:is=`1`:then=`
        <span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>
        `+]
        </div>