A
A
Aricus2021-09-28 16:40:21
1C-Bitrix
Aricus, 2021-09-28 16:40:21

Why isn't the component template displayed?

I am new to 1C-Bitrix. When one of the system templates is selected, the menu is displayed normally. When choosing a custom template (from the list in the component parameters), nothing is displayed. No error is thrown either.
Component call code:

<?$APPLICATION->IncludeComponent(
  "bitrix:menu", 
  "module_top", 
  array(
    "ROOT_MENU_TYPE" => "top",
    "MENU_CACHE_TYPE" => "N",
    "MENU_CACHE_TIME" => "3600000",
    "MENU_CACHE_USE_GROUPS" => "Y",
    "MENU_THEME" => "site",
    "CACHE_SELECTED_ITEMS" => "N",
    "MENU_CACHE_GET_VARS" => array(
    ),
    "MAX_LEVEL" => "2",
    "CHILD_MENU_TYPE" => "subtop",
    "USE_EXT" => "Y",
    "DELAY" => "N",
    "ALLOW_MULTI_SELECT" => "N",
    "COMPONENT_TEMPLATE" => "module_top"
  ),
  false
);?>

Component template files:
61531b0f5bcab370700747.png
where /local/templates/module/ is the site template.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aricus, 2021-09-29
@Aricus

If anyone is interested, the error was in the template itself. The base was taken from a template with modified results. Outside of the area that hit "Edit as Text" there was a condition that interrupted the rendering of the template.

R
Roman, 2021-09-29
@Ramapriya

1. when installing the module, move the components to the appropriate folder (/local/components/component_name)
2. inside the component folder, a templates folder must be created containing folders with templates. The default template is called .default
3. inside the template folder, place the style.css and template.php files.
Thus, the path to the component template should be as follows:

/local/components/bitrix/menu/module_top/templates/.default/template.php

Also examine the structure of the component

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question