T
T
Timur Kalimullin2018-06-08 12:04:13
1C-Bitrix
Timur Kalimullin, 2018-06-08 12:04:13

How to correctly configure the Bitrix composite to work with a dynamic area in a component template?

Good afternoon,
I am puzzled by the question of how to correctly update dynamic data from the Bitrix component template.
The bitrix:news component has been placed.

COMPOSITE_FRAME_TYPE = AUTO
CACHE_TYPE = A
CACHE_TIME = 3600

The detailed template of the component contains information that should not be cached by the component and dynamically updated, let's put a simple timestamp time().
Let's wrap it in a frame:
<?$frame = $this->createFrame('timer', false)->begin();?>
<?=time()?>
<?$frame->beginStub();?>
загрузка...
<?$frame->end();?>

The composite works, but the time is not updated, which is understandable, because. the component has the CACHE_TIME caching parameter specified.
Due to the peculiarity of the layout, I really don’t want to separate the data from the component and move the dynamic part outside template.php ... I
suspect that I will have to move the dynamics outside the component caching, but maybe there is a solution out of the box that will update the data? in the presence of bxrand, remove CACHE_TIME, somehow hard ..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ainur Valiev, 2018-06-09
@vaajnur

$staticHTMLCache = \Bitrix\Main\Data\StaticHTMLCache::getInstance();
$staticHTMLCache->disableVoting();
$APPLICATION->IncludeComponent(
  "bitrix:subscribe.edit", 
  "", 
  array(	),
  false
);
$staticHTMLCache->enableVoting();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question