|
1 2 3 4 |
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] |
https://yournet.info/blog/seo/kak-sdelat-301-redirekt-v-htaccess-s-www-na-bez-www
|
1 2 3 4 |
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] |
https://yournet.info/blog/seo/kak-sdelat-301-redirekt-v-htaccess-s-www-na-bez-www
Добавил директиву в конфигурацию Apache — /etc/httpd/bx/conf/bx_ext_yarmodul.ru.conf:
|
1 2 3 |
php_admin_value mbstring.func_overload 2 И перезагрузил веб-сервер: systemctl restart httpd |
Виртуальная машина Битрикс.
https://dev.1c-bitrix.ru/learning/course/?COURSE_ID=43&LESSON_ID=2943
http://bitrixhub.ru/bitriks-perenos-javascript-v-konets-stranitsy/
https://aspro.ru/docs/course/course36/lesson1744/ Для вывода в компоненте ID региона добавляем в шаблон global $arRegionLink; Далее получаем $arRegionLink[«PROPERTY_LINK_REGION»];
bitrix/php_interface/init.php
|
1 2 3 4 |
AddEventHandler("main", "OnEndBufferContent", "delete_type"); function delete_type(&$content) { $content = str_replace(" type=\"text/javascript\"", false, $content); } |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<? //выводим PDF из пользовательских полей CModule::IncludeModule("iblock"); $arFilter = Array('IBLOCK_ID'=>2, 'ID' => $arResult["SECTION"]["IBLOCK_SECTION_ID"]); $db_list = CIBlockSection::GetList(Array($by=>$order), $arFilter, true, array("UF_TO_DGU","UF_PNR_DGU")); while($ar_result = $db_list->GetNext()) { ?> <div class="pdf-icon"> <?if($ar_result["UF_TO_DGU"]):?> <a href="<?=CFile::GetPath($ar_result["UF_TO_DGU"])?>" target="_blank"><span></span> Регламент проведения ТО ДГУ</a> <?endif;?> <?if($ar_result["UF_PNR_DGU"]):?> <a href="<?=CFile::GetPath($ar_result["UF_PNR_DGU"])?>" target="_blank"><span></span> Регламент проведения ПНР ДГУ</a> <?endif;?> </div> <? } ?> |
|
1 |
$APPLICATION->SetPageProperty("robots", "noindex, nofollow"); |
У кого не выдает корректно в catalog.section SECTION_CODE_PATH в файл result_modifier.php шаблона компонента catalog.section добавьте код и очистите кеш.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
// замена поля DETAIL_PAGE_URL из настроек инфоблока, т.к. в catalog.section // не работает SECTION_CODE_PATH $arID = array(); foreach ($arResult['ITEMS'] as $arItem){ $arID[] = $arItem['ID']; } $arOrder = array("SORT" => "ASC"); $arFilter = array( 'IBLOCK_ID' => $arParams['IBLOCK_ID'], 'ACTIVE' => 'Y', 'ID' => $arID, ); $arSelect = array( 'ID', 'CODE', 'IBLOCK_ID', 'DETAIL_PAGE_URL', ); $dbRes = CIBlockElement::GetList($arOrder, $arFilter, false, false, $arSelect); while($arIt = $dbRes->GetNext()){ $arRes[$arIt['ID']] = $arIt['DETAIL_PAGE_URL']; } foreach ($arResult['ITEMS'] as &$arItem){ $arItem['DETAIL_PAGE_URL'] = $arRes[$arItem['ID']]; } |
Выводим древовидное меню из категорий и подкатегорий инфоблока
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
<? //$begin = microtime(true); $rsParentSection = CIBlockSection::GetList( Array('sort' => 'sort', 'sort' => 'asc'), Array('IBLOCK_ID' => 15, 'ACTIVE' => 'Y'), true, Array('UF_*') ); while ($arParentSection = $rsParentSection->GetNext()) {?> <?if($arParentSection["UF_IS_HIDE_MENU"] != 1):?> <?if($arParentSection["DEPTH_LEVEL"] == 1):?> <div class="menu-item"> <?endif?> <?if($arParentSection["DEPTH_LEVEL"] == 1):?> <div class="side-block-text-head"> <a href="<?=$arParentSection["SECTION_PAGE_URL"]?>"> <?=$arParentSection['NAME']?> </a> </div> <?endif?> <ul> <? $arFilter = array('IBLOCK_ID' => $arParentSection['IBLOCK_ID'],'>LEFT_MARGIN' => $arParentSection['LEFT_MARGIN'],'<RIGHT_MARGIN' => $arParentSection['RIGHT_MARGIN'],'>DEPTH_LEVEL' => $arParentSection['DEPTH_LEVEL']); // выберет потомков без учета активности $rsSect = CIBlockSection::GetList(array('left_margin' => 'asc'),$arFilter, true, Array('UF_*')); $el_count = 0; while ($arSect = $rsSect->GetNext()) {?> <li> <a class="menu-item-title" href="<?=$arSect["SECTION_PAGE_URL"]?>"><?=$arSect["NAME"]?></a><span class="menu-item-count"><?=$arSect["ELEMENT_CNT"];?></span> </li> <?}?> </ul> <?if($arParentSection["DEPTH_LEVEL"] == 1):?> </div> <?endif?> <?endif?> <? } //echo microtime(true) - $begin; ?> |
Вставить в шаблон catalog.element
|
1 2 3 4 5 6 7 8 9 |
if($arParams['ADD_SECTIONS_CHAIN'] && !empty($arResult['NAME'])) { $arResult['SECTION']['PATH'][] = array( 'NAME' => $arResult['NAME'], 'PATH' => ' '); $component = $this->__component; $component->arResult = $arResult; } |
Полезно когда необходимо разместить любой javascript на отдельно взятой странице в внутри <head>, микроразметки виджетов социальных сетей и вообще всего… что захочешь.
|
1 2 3 4 |
// В файле template.php компонента <?$this->SetViewTarget('mycontent');?> Здесь пишем свой код или вставляем какой-нибудь текст. <?$this->EndViewTarget();?> |
Вот такой …