This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php"); | |
$APPLICATION->SetPageProperty("NOT_SHOW_NAV_CHAIN", "Y"); | |
$APPLICATION->SetTitle("Импорт секций инфоблока"); | |
if(CModule::IncludeModule("iblock")) { | |
$arIBlocks = []; | |
$rsIBlocks = CIBlock::GetList(["sort" => "asc"], ["ACTIVE" => "Y"]); | |
while($arIBlock = $rsIBlocks->Fetch()) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('customize_register', 'dco_customize_register'); | |
function dco_customize_register($wp_customize) { | |
//FOOTER | |
$wp_customize->add_section('footer', array( | |
'title' => 'Подвал', | |
'priority' => 1, | |
)); | |
//footer text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* HEX Color sanitization callback. | |
* | |
* - Sanitization: hex_color | |
* - Control: text, WP_Customize_Color_Control | |
* | |
* Note: sanitize_hex_color_no_hash() can also be used here, depending on whether | |
* or not the hash prefix should be stored/retrieved with the hex color value. | |
* | |
* @see sanitize_hex_color() https://developer.wordpress.org/reference/functions/sanitize_hex_color/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$res = CIBlockSection::GetList( | |
Array('name' => 'asc'), | |
Array('IBLOCK_ID' =>'5' , 'ACTIVE' => 'Y') | |
); | |
while ($row = $res->GetNext()) | |
{ | |
echo $row['NAME'].'<br>'; | |
$rsParentSection = CIBlockSection::GetByID($row['ID']); | |
if ($arParentSection = $rsParentSection->GetNext()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
для вот такого аjax поиска нам нужно не много. | |
файл search.php , в нужной вам папке (написано на d7 c костылем) | |
https://ftask.ru/category/bitrix/d7/ | |
<? | |
/** | |
* Created by PhpStorm. | |
* User: | |
* Date: 14.09.2018 | |
* Time: 12:51 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://myrusakov.ru/html-srcset.html | |
Фавикон генератор | |
Для генерации фавиконки воспользуемся онлайн-генератором https://realfavicongenerator.net. | |
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> | |
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> | |
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> | |
<link rel="manifest" href="/site.webmanifest"> | |
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5"> | |
<meta name="msapplication-TileColor" content="#da532c"> | |
<meta name="theme-color" content="#ffffff"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('form[name="faq-ui-dialog"] input[type="submit"]').click(function(){ | |
var Error = false, | |
ErrorList = ''; | |
Captcha = $('form[name="faq-ui-dialog"] input[name="captcha_word"]').val(); | |
if($('form[name="faq-ui-dialog"] input[name="PHONE"]').val() == '' ){ | |
Error=true; | |
ErrorList+='Вы не ввели телефон или ввели его не верно!<br/>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$infoblock = 13; // Инфоблок с id 13 | |
$rs_Section = CIBlockSection::GetList(array('left_margin' => 'asc'), array('IBLOCK_ID' => $infoblock)); | |
while ( $ar_Section = $rs_Section->Fetch() ) | |
{ | |
$ar_Resu[] = array( // собираем массив того, что нам нужно | |
'ID' => $ar_Section['ID'], // id раздела | |
'NAME' => $ar_Section['NAME'], // имя раздела (что нас собственно интересует) | |
'IBLOCK_SECTION_ID' => $ar_Section['IBLOCK_SECTION_ID'], | |
'IBLOCK_SECTION_ID' => $ar_Section['IBLOCK_SECTION_ID'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Предварительно подготовим инфоблок, который будет использовать меню. Пусть его ID=1. | |
Во-первых нужно настроить(рис. 1): | |
URL страницы раздела | |
URL страницы детального просмотра | |
https://thisis-blog.ru/wp-content/uploads/2016/05/QIP-Shot-Screen-218.png | |
Далее настройка доступа — чтение для всех пользователей(рис. 2) | |
https://thisis-blog.ru/wp-content/uploads/2016/05/QIP-Shot-Screen-219-900x272.png | |
Кастомизация компонента | |
Для реализации потребуется перенести menu.sections в своё пространство имён и кастомизировать его. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Иногда нужно сделать переход на страницу 404, если на сайте не найдены раздел и элемент. Галочка "Устанавливать статус 404, если не найдены элемент или раздел" в настройках компонента такого перехода не обеспечивает, остаемся в разделе Каталог. | |
Чтобы это исправить, я воспользовалась статьей | |
Но после сделанного переход так и не происходил. Несмотря на то, что в консоле браузера стоял статус 404, переменная ERROR_404 все-равно была не определена. | |
Тогда я в файле /bitrix/templates/шаблон_сайта/components/bitrix/catalog/шаблон_каталога/section.php написала проверку | |
if(!$arResult["VARIABLES"]["SECTION_ID"]){ | |
CHTTP::SetStatus("404 Not Found"); | |
@define("ERROR_404","Y"); | |
} |
OlderNewer