R
R
run1822018-10-06 19:01:54
1C-Bitrix
run182, 2018-10-06 19:01:54

How to remove an item from breadcrumbs?

You need to remove one item and add another.
It is added using AddChainItem, but how to remove it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2018-10-08
@run182

No way because it is a chain and such an action with it is not expected and is not necessary. Those. generally speaking, there is no situation when this may be required, and if such a situation exists, then this is a design error and it is necessary to correct it, and not try to screw up the mechanism for getting rid of the consequences.
As a last resort, all you can do is write your own implementation of the chain output and get it when outputting it using GetNavChain, make the required corrections and output it yourself.
However, the same can be implemented in the breadcrumbs template - get rid of unnecessary items.
But it's better not to add unnecessary items if they are not needed. There are no barriers to doing so.

D
darton1, 2021-12-16
@darton1

filter the $APPLICATION->arAdditionalChain array
but remember that great power comes with great responsibility

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question