S
S
Sergey2016-04-19 14:09:52
1C-Bitrix
Sergey, 2016-04-19 14:09:52

Why is layout running when using component_epilog.php?

Good afternoon.
Help solve the problem by calling "Breadcrumbs" inside another component's template.
there is a component template

<section class="product-page">
    <div class="container">
        <!-- Breadcrumbs -->
        <div class="breadcrumbs">
            <p>
                <?$APPLICATION->ShowViewContent('breadcrumb');?>
            </p>
        </div>
        <!-- End Breadcrumbs -->

        <h1><?php echo $arResult['NAME']; ?></h1>

        <!-- Product info -->
        <div class="table image">
            <div class="table-cell">
                <div id="slider" class="flexslider">
                    <ul class="slides">
                        <?php foreach ($arResult['MORE_FOTO'] as $foto) { ?>
                            <li>
                                <img src="<?php echo $foto['src']; ?>" />
                            </li>
                        <?php } ?>
                    </ul>
                </div>
                <div id="carousel" class="flexslider">
                    <ul class="slides">
                        <?php foreach ($arResult['MORE_FOTO_THUMB'] as $foto) { ?>
                            <li>
                                <img src="<?php echo $foto['src']; ?>" />
                            </li>
                        <?php } ?>
                    </ul>
                </div>
            </div>
            <div class="table-cell">
                <?php foreach ($arResult['PROPERTIES']['SHORT_TEHCNICAL']['VALUE'] as $key => $tech) { ?>
                    <div class="table">
                        <div class="table-cell"><p><?php echo $tech; ?></p></div>
                        <div class="table-cell"></div>
                        <div class="table-cell"><p><?php echo $arResult['PROPERTIES']['SHORT_TEHCNICAL']['DESCRIPTION'][$key]; ?></p></div>
                    </div>
                <?php } ?>
                <?php if ($arResult['PROPERTIES']['OPTIONS']['~VALUE']['TEXT']) { ?>
                    <div class="btn-details">Возможные&nbsp;опции</div>
                    <div class="hide">
                        <?php echo $arResult['PROPERTIES']['OPTIONS']['~VALUE']['TEXT']; ?>
                    </div>
                <?php } ?>
                <div class="advantages">
                    <figure>
                        <img src="<?=SITE_TEMPLATE_PATH?>/images/catalog/delivery.png" alt="Срок поставки">
                        <figcaption>
                            <p>Срок поставки от 10 дней</p>
                        </figcaption>
                    </figure>
                    <figure>
                        <img src="<?=SITE_TEMPLATE_PATH?>/images/catalog/warrant-product.png" alt="Срок поставки">
                        <figcaption>
                            <p>Гарантия от производителя</p>
                        </figcaption>
                    </figure>
                    <figure>
                        <img src="<?=SITE_TEMPLATE_PATH?>/images/catalog/map-product.png" alt="Срок поставки">
                        <figcaption>
                            <p>Доставка по СНГ и России</p>
                        </figcaption>
                    </figure>
                </div>
                <p class="price"><?php echo $arResult['PROPERTIES']['PRICE']['VALUE']; ?></p>
                <div class="btn">Заказать&nbsp;звонок</div>
            </div>
        </div>
        <!-- End Product info -->
    </div>
</section>

and file component_epilog.php
<?php if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @global CMain $APPLICATION */

$this->initComponentTemplate();
$this->__template->SetViewTarget('breadcrumb');

    $APPLICATION->IncludeComponent(
        "bitrix:breadcrumb",
        "breadcrumbs_catalog",
        array(
            "COMPONENT_TEMPLATE" => "breadcrumbs_catalog",
            "PATH" => "",
            "SITE_ID" => "-",
            "START_FROM" => "1"
        ),
        false
    );

$this->__template->EndViewTarget(); ?>

in the component template I am trying to display what is in component_epilog.php
<?$APPLICATION->ShowViewContent('breadcrumb');?>
After resetting the cache, the page loads normally, if the page is loaded from the cache, the layout is cut out of the html tags, as a result, the page is displayed incorrectly

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-04-19
@Logic87

Something is wrong. Your breadcrumbs are cached in a cached component.
Now I'm considering two options:
The first option is more correct and does not load the processing and rendering of the page in the browser.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question