onBuildTemplateCreateUrl
Event allows catching a click to directly create a site or landing page by template.
Parameters
Parameter | Description | Available from version |
---|---|---|
code | Symbolic code for selection template. |
|
Example
Example demonstrates reaction to replacement of a click for SPA template
$eventManager = \Bitrix\Main\EventManager::getInstance(); $eventManager->addEventHandler('landing', 'onBuildTemplateCreateUrl', function(\Bitrix\Main\Event $event) { $result = new \Bitrix\Main\Entity\EventResult; $code = $event->getParameter('code'); if ($code == 'spa') { $result->modifyFields([ 'onclick' => "alert(123);" ]); } return $result; } );
© «Bitrix24», 2001-2024