L
L
lexstile2018-05-07 18:13:43
1C-Bitrix
lexstile, 2018-05-07 18:13:43

How to customize the search.title component in Bitrix?

Task: you need to add a search for a specific property to the live search by title.
I added CSearch instead of CSearchTitle to conponent.php, adjusted the parameters and everything seemed to work.
But the results are displayed only for the entire line of the property, I enter one character less - it is no longer looking.
How can I make it search by substring?
Call:

$APPLICATION->IncludeComponent(
  "sitename:search.title", 
  "search_to_header", 
  array(
    "CATEGORY_0" => array(
      0 => "iblock_1c_catalog",
    ),
    "CATEGORY_0_TITLE" => "Товары",
    "CHECK_DATES" => "N",
    "CONTAINER_ID" => "title-search",
    "INPUT_ID" => "title-search-input",
    "NUM_CATEGORIES" => "1",
    "ORDER" => "date",
    "PAGE" => "#SITE_DIR#search/index.php",
    "SHOW_INPUT" => "Y",
    "SHOW_OTHERS" => "N",
    "RESTART"=>"Y",
    "TOP_COUNT" => "10",
    "USE_LANGUAGE_GUESS" => "Y",
    "COMPONENT_TEMPLATE" => "search_to_header",
    "CATEGORY_0_iblock_1c_catalog" => array(
      0 => "4",
    )
  ),
  false
);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question