R
R
Roman2015-09-17 11:56:57
1C-Bitrix
Roman, 2015-09-17 11:56:57

How to connect sub menu with static menu!?

Good afternoon!
How to connect a dynamic submenu to a static menu in Bitrix!?
We have code:

<?
$aMenuLinks = Array(
  Array(
    "Каталог", 
    "catalog/", 
    Array(), 
    Array(), 
    "" 
  ),
  Array(
    "О компании", 
    "about/", 
    Array(), 
    Array(), 
    "" 
  ),
  Array(
    "Доставка", 
    "faq/delivery/", 
    Array(), 
    Array(), 
    "" 
    )
);
?>

Need to:
Array(
    "Каталог", 
    "catalog/", 
    Array(), 
    Array(), 
    "" 
  ),

Connect the dynamics, what would be under the menu:
- каталог
-- каталог/раздел (динамика - инфоблок)
-- каталог/раздел (динамика - инфоблок)
- о компании
- доставка

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Tupikov, 2015-09-17
@2amedia

In the menu settings, set the nesting level to 2, the menu type for the remaining levels is "Left Menu"
In the folder to which the first link leads Directory, put the file left.menu_ext.php
Add the following code to the file

<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();

global $APPLICATION;

$aMenuLinksExt=$APPLICATION->IncludeComponent("bitrix:menu.sections", "", array(
  "IS_SEF" => "Y",
  "SEF_BASE_URL" => "",
  "SECTION_PAGE_URL" => "#SECTION_ID#/",
  "DETAIL_PAGE_URL" => "#SECTION_ID#/#ELEMENT_ID#",
  "IBLOCK_TYPE" => "products",
  "IBLOCK_ID" => "2",
  "DEPTH_LEVEL" => "1",
  "CACHE_TYPE" => "A",
  "CACHE_TIME" => "36000000"
  ),
  false
);

$aMenuLinks = array_merge($aMenuLinks, $aMenuLinksExt);

?>

where IBLOCK_ID - ID of your infoblock

R
Roman, 2015-09-17
@RGBPlus

Now we are on /m/
But, it’s not like that, it doesn’t want to connect (((
file /m/catalog/left.menu_ext.php - with the above code lies (id is specified)
71ecb42c5e2247ffb6a1d53b02479dcc.jpg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question