Answer the question
In order to leave comments, you need to log in
Breadcrumbs not on all pages?
It is necessary to make such a structure of the site, where some pages have breadcrumbs and some do not. What is the best way to implement? I know 2 options:
1. Create an empty include area in the template and insert the component connection code into this area in those sections in which breadcrumbs are needed. In this case, we will copy the same code many times wherever we need to connect them.
2. Somewhere in the template, specify an array of pages to which you need to connect breadcrumbs and connect only to them.
Perhaps there is another option? What would you do?
Answer the question
In order to leave comments, you need to log in
On the required page of the site, define BEFORE CONNECTING require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); DISABLE_BREADCRUMBS constant. In header.php we check the existence of this constant. Simple, convenient and hassle-free. The downside is that not every content manager will be able to add such a constant without breaking anything on the page.
I think you will obviously have few "some pages", then in this case, draw a conclusion on the conditions in the site template.
condition for whole directory-section
<?if (CSite::InDir ('/page/')): ?>
//no breadcrumbs
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question