We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33992 ☆ A M B ☆
    • 455 Posts
    Hello,

    I use snippet call below in a site resource to show result list and i want to show intro_message when there is no valid search (no keyword is set) but it shows nothing!

    [!AjaxSearch? &AS_showForm=`0` &ajaxSearch=`0`!]



    I checked ajaxSearch.class.inc.php lines to find problem.
    <?php
    221      else { // init the input field
    222        $this->varLayout['showResults'] = 0;
    223        $this->varLayout['showIntro'] = 1;
    224        $this->varLayout['introMessage'] = $this->_lang['as_introMessage'];
    225      } // end if not validSearch
    226    } // end if showResults

    In line 221 the ELSE statement is executes and sets 1 as value of $this->varLayout[’showIntro’]. It leaves ELSE well BUT after second "}", $this->varLayout is overwritten to form data (formid, result link, inputOption,...)! and there is no $this->varLayout[’showIntro’] item...


    Can any one help me?


      God loves me. 【ツ】


      MODX.ir (Persian Support)

      Boplo.ir/modx/ (Persian)
      • 5811
      • 1,717 Posts
      and i want to show intro_message when there is no valid search (no keyword is set) but it shows nothing!
      Adds $this->varLayout[’showIntro’] = 1; in the block when an error occurs:
              $this->varLayout['showIntro'] = 1;
              $this->varLayout['showResults'] = 1;
              $this->varLayout['results'] = $this->chkResults->Render()."\n";
              unset($this->varResults);
              unset($this->chkResults);
            }

      And remove or comment the line $this->varLayout[’showIntro’] = 0; in the ajaxSearch block:
          if ($this->cfg['ajaxSearch']) {
            //$this->varLayout['showIntro'] = 0;
            $this->varLayout['showResults'] = 1;
            $this->varLayout['results'] = OUTPUT_ID;
          }

      I am rewriting AjaxSearch for ajaxSearch 1.9, so don’t worry for the portability ot this hack wink