Comment to 'Keyword Search'
Comment to Keyword Search
  • No, then you'd better redeclare the method getKeyTitlesPairs in the BxTemplSearch class of your template. It should have a look like:

    private function getKeyTitlesPairs ()

        {

            $a = array();

            foreach ($this->aClasses as $sKey => $r)

    if ($sKey == 'bx_timeline' || $sKey == 'bx_timeline_cmts')

    continue;

                if ($this->_sMetaType || $r['GlobalSearch'])

                    $a[$sKey] = _t($r['title']);

            return $a;

        }

    The bold part is the addon to exclude Timeline and Timeline comments form the search keyword form.

    Thanks LeonidS . getKeyTitlesPairs () changes the list of options/vlaues appearing under 'Section' of the search form only, but does not exclude timeline from search results when the 'global search' / 'select all' option is chosen. it sounds that we need to do something with the public function getForm() with BxBaseSearch class. any ideas?

    • Then you need to exclude Timeline in this part of response method

      if (!$this->_sMetaType && !$aValue['GlobalSearch'])

                      continue;

      or directly in the __construct in this part:

      $this->aClasses = BxDolDb::getInstance()->fromCache('sys_objects_search', 'getAllWithKey',

                 'SELECT `ID` as `id`,

                         `Title` as `title`,

                         `ClassName` as `class`,

                         `ClassPath` as `file`,

                         `ObjectName`,

                         `GlobalSearch`

                  FROM `sys_objects_search`

                  ORDER BY `Order` ASC', 'ObjectName'

              );