seo

Использование SEO данных инфоблока через API

06.06.2014 Bitrix ,

Получить поля SEO для элемента можно так:

CModule::IncludeModule("iblock");
 
$rsSection = CIBlockSection::GetList(
    array(),
    array(
        "IBLOCK_ID" => $arParams['IBLOCK_ID'],
        "ACTIVE"=>"Y",
        "=CODE"=>$arParams["SECTION_CODE"]),
    false);
 
if($arSection = $rsSection->GetNext()){
 
$ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues(
        $arSection["IBLOCK_ID"],
        $arSection["ID"]
    );
    $arSection["IPROPERTY_VALUES"] = $ipropValues->getValues();
    echo '<pre>'; print_r($arSection["IPROPERTY_VALUES"]); echo '</pre>';
}

Поля SEO для раздела можно получить похожим способом:

CModule::IncludeModule("iblock");
 
$rsSection = CIBlockSection::GetList(
    array(),
    array(
        "IBLOCK_ID"=>$arParams['IBLOCK_ID'],
        "ACTIVE"=>"Y",
        "=CODE"=>$arParams["SECTION_CODE"]),
        false
        );
 
if($arSection = $rsSection->GetNext()){
 
$ipropValues = new \Bitrix\Iblock\InheritedProperty\SectionValues(
    $arSection["IBLOCK_ID"],
    $arSection["ID"]
    );
     
    $arSection["IPROPERTY_VALUES"] = $ipropValues->getValues();
    echo "<pre>"; print_r($arSection); echo '</pre>';
}

Оригинал статьи тут http://yournet.kz/blog/bitrix/ispolzovanie-seo-dannyx-v-infobloke-cherez-api

robots.txt для битрикса

21.02.2013 Bitrix No comments

User-agent: *
Disallow: /bitrix/
Disallow: /search/
Disallow: /auth/
Disallow: /auth.php
Disallow: /*/search/
Disallow: /*PAGE_NAME=search
Disallow: /*PAGE_NAME=user_post
Disallow: /*PAGE_NAME=detail_slide_show
Disallow: /*/slide_show/
Disallow: /*/gallery/*order=*
Disallow: /*?print=
Disallow: /*&print=
Disallow: /*register=yes
Disallow: /*forgot_password=yes
Disallow: /*change_password=yes
Disallow: /*login=yes
Disallow: /*logout=yes
Disallow: /*auth=yes
Disallow: /*action=ADD_TO_COMPARE_LIST
Disallow: /*action=DELETE_FROM_COMPARE_LIST
Disallow: /*action=ADD2BASKET
Disallow: /*action=BUY
Disallow: /*print_course=Y
Disallow: /*bitrix_*=
Disallow: /*backurl=*
Disallow: /*BACKURL=*
Disallow: /*back_url=*
Disallow: /*BACK_URL=*
Disallow: /*back_url_admin=*