L
L
LB7772015-04-02 17:30:36
1C-Bitrix
LB777, 2015-04-02 17:30:36

How to insert a form into Bitrix news?

I have forms on the site already prepared for Ajax. They work fine on the whole site, but when I insert any form into the news template (\bitrix\templates\new_main_rus\components\bitrix\news\news\bitrix\news.detail\.default\template.php) everything falls apart.
After resetting the cache, this form (or all the news with the form) “flies” to the very top of the site (above the header), and when you re-access it, it is not displayed at all.
I noticed that when the "AJAX_MODE" => "Y" parameter is set to N, the display becomes normal, but the Ajax sending does not work accordingly.
Form Code

<?$APPLICATION->IncludeComponent(
  "bitrix:form",
  "",
  Array( 
    "AJAX_MODE" => "Y",
    "SEF_MODE" => "N",
    "WEB_FORM_ID" => "15",
    "RESULT_ID" => $_REQUEST[RESULT_ID],
    "START_PAGE" => "new",
    "SHOW_LIST_PAGE" => "N",
    "SHOW_EDIT_PAGE" => "N",
    "SHOW_VIEW_PAGE" => "N",
    "SUCCESS_URL" => "",
    "SHOW_ANSWER_VALUE" => "N",
    "SHOW_ADDITIONAL" => "N",
    "SHOW_STATUS" => "Y",
    "EDIT_ADDITIONAL" => "N",
    "EDIT_STATUS" => "Y",
    "NOT_SHOW_FILTER" => array(),
    "NOT_SHOW_TABLE" => array(),
    "CHAIN_ITEM_TEXT" => "",
    "CHAIN_ITEM_LINK" => "",
    "IGNORE_CUSTOM_TEMPLATE" => "N",
    "USE_EXTENDED_ERRORS" => "N",
    "CACHE_TYPE" => "A",
    "CACHE_TIME" => "3600",
    "AJAX_OPTION_JUMP" => "N",
    "AJAX_OPTION_STYLE" => "Y",
    "AJAX_OPTION_HISTORY" => "Y",
    "VARIABLE_ALIASES" => Array(
      "action" => "action"
    )
  ),
false
);?>

but again, this behavior does not depend on the form, but depends on whether Ajax is enabled or not.
How to insert an Ajax form into the news so that it is displayed where I need it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2015-04-03
@LB777

Because you are inserting a component into a template which is cached.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question