We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30319
    • 406 Posts
    ajaxSearch 1.8.4, this was fairly easy...
    ajaxSearch 1.9.0, very opaque/difficult...

    results.tpl.html and grpresult.tpl.html don’t make it clear how to do the following

    <p>Result Page Title (only, nothing else)<p>
    <p>show the extract</p>

    next result...

    my current chunk is

    [+as.noResults:is=`1`:then=`
      <p class="[+as.noResultClass+]">
        [+as.noResultText+]
      </p>
    `:else=`
    <h2 class="ajaxSearch_resultsInfos">[+as.resultsFoundText+]</h2>
    [+as.listGrpResults+]
    `+]


    I know I must swap out as.listGrpResults but the docs are not clear to me what I should put instead into a results chunk to display what I want...

    I unsuccessfully tried, which shows no results:

    [+as.pagetitle+], [+as.pagetitleShow+]
    [+as.content+], [+as.contentShow+]


    Thank you, Tom



      • 5811
      • 1,717 Posts
      The results template include the grpResult template which include the result template.

      Results (results.tpl.html) :
      [+as.noResults:is=`1`:then=`
        <div class="[+as.noResultClass+]">
          [+as.noResultText+]
        </div>
      `:else=`
      <p class="ajaxSearch_resultsInfos">[+as.resultsFoundText+]<span class="ajaxSearch_resultsDisplayed">[+as.resultsDisplayedText+]</span></p>
        [+as.listGrpResults+]
      `+]
      [+as.showCmt:is=`1`:then=`
      [+as.comment+]
      `+]
      [+as.listGrpResults+] => one or several group of results (grpResult.tpl.html).

      A group of results (grpResult.tpl.html) :
      [+as.grpResultsDef:is=`1`:then=`
      <div id="[+as.grpResultId+]" class="ajaxSearch_grpResult">
      [+as.headerGrpResult+]
      [+as.footerGrpResult+]
      [+as.listResults+]
      [+as.footerGrpResult+]
      </div>
      `:else=`
      <div class="ajaxSearch_grpResultName">[+as.grpResultNameShow:is=`1`:then=`[+as.grpResultName+]`+]
      <span class="ajaxSearch_grpResultsDisplayed">[+as.grpResultsDisplayedText+]</span></div>
      `+]
      [+as.listResults+] => one or several result

      A result (result.tpl.html):
      <div class="[+as.resultClass+]">
        <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a>
      [+as.descriptionShow:is=`1`:then=`
        <span class="[+as.descriptionClass+]">[+as.description+]</span>
      `+]
      [+as.extractShow:is=`1`:then=`
        <div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
      `+]
      [+as.breadcrumbsShow:is=`1`:then=`
        <span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>
      `+]
      </div>


      By default, if you don’t use the parameter &category, you don’t display any group of results name, even if you use by default the grpResult.tpl.html.
      If you would retrieve the 1.8.5 pagination, add &pagingType=`0`.
      As example look at the "non-ajax mode / paging type 0" demo.

      1/ If you don’t want the total number of displayed results, open the results.tpl.html and erase
      <p class="ajaxSearch_resultsInfos">[+as.resultsFoundText+]<span class="ajaxSearch_resultsDisplayed">[+as.resultsDisplayedText+]</span></p>

      2/ If you don’t want the displaying of results for a group, open the grpResult.tpl.html and erase
      [+as.headerGrpResult+]


        • 30319
        • 406 Posts
        This is not the explanation I need.

        I want to know how to display all results as follows:

        1. Display ONLY the page title, nothing else, on one line

        2. Display ONLY the extract on one line, nothing else

        Example:

        Page Title

        ...balas dad asd ada a d asdasf adaf adaf adas...

        Similar to how Google displays page results.

        Present implementation displays additional data (introtext, longdesc, etc.) along with page title.
        Present implementation does not allow styling the extract...

        In other words, how to control EXACTLY what items appear per result (only pagetitle and

        Thank you, Tom

          • 5811
          • 1,717 Posts
          1. Display ONLY the page title, nothing else, on one line
          => delete from the result.tpl.html file, the code below:
          [+as.descriptionShow:is=`1`:then=`
            <span class="[+as.descriptionClass+]">[+as.description+]</span>
          `+]


          2. Display ONLY the extract on one line, nothing else
          &extract=`1:content`
            • 30319
            • 406 Posts
            I tried that...it doesn’t work.

            My landing page says:

            [!AjaxSearch? &ajaxSearch=`0` &showResults=`1` &showInputForm=`0` &grabMax=`100` &pagingType=`0` &extract=`2:content` &whereSearch=`content:pagetitle,content` &tplResults=`results_tpl3`!]


            results_tpl3 says:

            <div class="[+as.resultClass+]">
              <a class="[+as.resultLinkClass+]" href="[+as.resultLink+]" title="[+as.longtitle+]">[+as.pagetitle+]</a>
            [+as.descriptionShow:is=`1`:then=`
              <span class="[+as.descriptionClass+]">[+as.description+]</span>
            `+]
            [+as.extractShow:is=`1`:then=`
              <div class="[+as.extractClass+]"><p>[+as.extract+]</p></div>
            `+]
            [+as.breadcrumbsShow:is=`1`:then=`
              <span class="[+as.breadcrumbsClass+]">[+as.breadcrumbs+]</span>
            `+]
            </div>
            


            NO results appear, why??

            Please see the example I set in my previous email.
            This should not be difficult.
            I will continue experimenting...this app could be better documented.

            Thank you, Tom

              • 30319
              • 406 Posts
              Here is how my results presently appear:

              Intellectual Disabilities Information FAQ topics: disability, handicap, intellectual disabilities, how Mountain Lake Services works with intellectually disabled people.

              The part that says ’FAG...’ is the page description, I don’t want this to appear, I want this as its OWN <p> tag

              I specified 2 extracts with content, I want each extract within a <p> tag.

              ... organized into three sections: Disability vs. Handicap, Intellectual Disabilities Mountain Lake Services’ Individual Approaches to Intellectually Disabled People Resources about Disabilities, intellectual ...
              ... and FAE can be prevented by a woman’s not drinking alcohol while she is pregnant. Mountain Lake Services’ Individual Approaches How do you work with intellectually disabled people? We constantly strive ...

              Employment
              Mountain Lake Services always seeks energetic, motivated people who want to make a difference in the lives of people with ...
              ... training, counseling, and emotional support as needed. Be actively involved in developing supports and services to each person served. Carry out specific strategies identified in the individualized service plan ...

              The results template creating these results is:

              [+as.noResults:is=`1`:then=`
              <p class="[+as.noResultClass+]">
              [+as.noResultText+]
              </p>
              `:else=`
              <h2 class="ajaxSearch_resultsInfos">[+as.resultsFoundText+]</h2>
              [+as.listGrpResults+]
              `+]

              Which template file do I change into a chunk to get the formatting I want??

              Thank you, Tom


                • 5811
                • 1,717 Posts
                The part that says ’FAG...’ is the page description, I don’t want this to appear, I want this as its OWN <p> tag
                If you don’t want the description, remove from the result.tpl.html file the code:
                [+as.descriptionShow:is=`1`:then=`
                  <span class="[+as.descriptionClass+]">[+as.description+]</span>
                `+]

                If you want frame the description by your own <p></p> tag, add it in the same file. But You could be better to adapt the class tag ajaxSearch_resultDescription, used to style the description label.


                I specified 2 extracts with content, I want each extract within a <p> tag.
                All the extracts are framed by a <p></p>. If you would like frame each piece of the extract try to use the extract separator. In you case add &extractSeparator=`</p>
                <p>`. I never tested this separator but it could work ...

                ---- &extractSeparator : Define how separate extracts      (optional)
                        html tag like <br /> or <hr /> or any other html tag
                        Default : "<br />"