Y
Y
Yastr2018-05-04 13:22:56
1C-Bitrix
Yastr, 2018-05-04 13:22:56

How to find out that we are in the product card of the catalog component?

Hello.
Can you please tell me if Bitrix has the ability to determine the product card page?
In the design, on all pages except this one, the container is the main standard (bootstrap .conainer), and in the full-width card (.container-fluid). I don't want to tear out the content width part from the header.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Zakharov, 2018-05-04
@Yastr

Do through the deferred functions
in footer.php at the end we write a function that, depending on the conditions, performs the actions we need

function containerWidth() {
        global $APPLICATION;
        ob_start();

        if(strlen($APPLICATION->GetProperty('fullWidthContainer')) > 0) {
            echo 'container-fluid';
        } else {
            echo 'container';
        }
        $result = ob_get_contents();
        ob_end_clean();
        return $result;
    }

in header.php in the place we need
and on the pages we need, set the fullWidthContainer property
in your case to catalog.detail or news.detail in component_epilog.php
The code has not been tested, but the meaning is clear

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question