W
W
wagwandude2016-06-11 17:30:33
PHP
wagwandude, 2016-06-11 17:30:33

How to make a condition for a section and its subsections?

Good afternoon.
I am already finishing work on an online store for 1C-Bitrix, I encountered such a problem as displaying a certain background for a certain section and its subsections.
Those. it is necessary to write a condition so that some text is displayed only on the pages of the section and its subsections.
Tried like this:

<?php if(CSite::InDir('/catalog/tovary_dlya_detey/')) { ?> style="background:url('<?=SITE_TEMPLATE_PATH?>/images/texture.png')"<?php } ?>

But the problem is that the section subsection links are in the second nesting, just like the link of the section itself. Accordingly, this method does not work.
Tell me how to do exactly what I intended with the help of conditions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-06-13
@Logic87

Depending on where you display this style. You can not only check the address. For example, you can by section ID.
And according to the links you can use php explode and del check.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question