Answer the question
In order to leave comments, you need to log in
Can't filter by content in Bitrix?
I'm trying to filter sections like this:
<ul>
<?
$arSelect=array('UF_TITLE','UF_KEYWORDS','UF_DESCRIPTION','UF_AFTER_TEXT','UF_ALT');
$arFilter=array(
'IBLOCK_ID' => 1,
array(
"LOGIC" => "OR",
'NAME'=>'%'.$_REQUEST['q'].'%',
'DESCRIPTION'=>'%'.$_REQUEST['q'].'%',
),
);
$rsSect = CIBlockSection::GetList(array('left_margin' => 'asc'),$arFilter,false,$arSelect);
while ($arSect = $rsSect->GetNext())
{
?>
<li><a href="<?=$arSect['SECTION_PAGE_URL']?>"><?=$arSect['NAME']?></a></li><?
}
?>
</ul>
Answer the question
In order to leave comments, you need to log in
$arFilter=array(
'IBLOCK_ID' => 1,
array(
"LOGIC" => "OR",
array('NAME'=>'%'.$_REQUEST['q'].'%'),
array('UF_DESCRIPTION'=>'%'.$_REQUEST['q'].'%'),
),
);
Судя по коду метода CIBlockSection::GetFilter, фильтровать по полю DESCRIPTION нельзя.
Нужно искать обходные пути или поправить метод.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question