FAQ Section Setup on 1C-Bitrix
FAQ on Bitrix is always a compromise between editor simplicity and developer flexibility. Two main approaches: infoblock with "question-answer" elements or support module. For public FAQ on site, infoblock is preferable.
Infoblock for FAQ: Minimal Structure
Create infoblock with symbol code faq. Element properties:
- Element name = question (field
NAMEinb_iblock_element) - Detailed description = answer (field
DETAIL_TEXT) -
SORT— sorting questions within category -
CATEGORY— property typeSection Bindingfor grouping by topics
Infoblock sections (b_iblock_section) serve as FAQ categories — "Delivery", "Payment", "Warranty". Better than separate property because sections support nesting and auto-filter in components.
Flag ACTIVE lets editors temporarily hide questions without deletion. Important — without it you delete and recreate.
Display Component and Accordion
For FAQ list optimal is bitrix:news.list with IBLOCK_ID parameter of your FAQ infoblock. Detailed pages for FAQ usually unnecessary — everything displays on one page as accordion.
In template.php iterate $arResult["ITEMS"] and for grouping by categories use property $arItem["IBLOCK_SECTION_ID"]. Pre-load sections via CIBlockSection::GetList() in component_epilog.php and build map section_id => section_name.
Accordion — pure CSS or minimal JS. Without jQuery, without libraries:
document.querySelectorAll('.faq-question').forEach(el => {
el.addEventListener('click', function() {
this.closest('.faq-item').classList.toggle('is-open');
});
});
Open question state in localStorage — optional but useful for long FAQ.
Schema.org Markup for SEO
FAQ is one of few content types where Google shows rich results in search. FAQPage markup adds questions and answers directly in search snippet.
In component template generate JSON-LD:
$faqSchema = ['@context' => 'https://schema.org', '@type' => 'FAQPage', 'mainEntity' => []];
foreach ($arResult["ITEMS"] as $item) {
$faqSchema['mainEntity'][] = [
'@type' => 'Question',
'name' => $item["NAME"],
'acceptedAnswer' => ['@type' => 'Answer', 'text' => strip_tags($item["DETAIL_TEXT"])]
];
}
echo '<script type="application/ld+json">' . json_encode($faqSchema, JSON_UNESCAPED_UNICODE) . '</script>';
Google limit: not more than 20 questions in markup per page. If FAQ is large — output markup only for top 20 elements by sort.
Search in FAQ
For large question count need filtering. Bitrix standard search module (search) auto-indexes infoblock elements — just enable USE_SEARCH = Y in infoblock settings. bitrix:search.page component outputs results with infoblock limit.
For instant search (no page reload) — filter by data-question attribute via JS directly in DOM: fast, no server requests, works on hundreds of questions without degradation.







