V
V
VoRoN19992020-07-30 13:29:42
1C-Bitrix
VoRoN1999, 2020-07-30 13:29:42

How to create a binding to an infoblock element? How to get SEO in the old core?

1) There are 2 information blocks questions and answers.
An answer is attached to a question through the element property (there can be several answers, so this is a multiple field)

I can attach answers to a question, but a question to an answer?
I need to implement an answer binding to a question.

2) $ipropValues ​​= new \Bitrix\Iblock\InheritedProperty\ElementValues($arParams["IBLOCK_ID"], $arFields["ID"]);
$IPROPERTY = $ipropValues->getValues();

What is the analogue on the old kernel?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
PetrPo, 2020-07-30
@PetrPo

An answer is attached to a question through the element property
. I can attach answers to a question, but a question to an answer?
I need to implement an answer binding to a question.

The answer to your question is in the question. What are you carrying?

S
serginhold, 2020-07-30
@serginhold

you should have at least 3 tables, not 2
1) questions
2) answer options
3) answers that link to questions and options, to the user (or who answers there)
and for the old api, see the documentation
https://dev .1c-bitrix.ru/api_help/iblock/classes/c...
https://dev.1c-bitrix.ru/api_help/iblock/classes/c
... arSelectFields at least highloadblock

A
Anton, 2020-07-30
@anton99zel

What is the analogue on the old kernel?

CIBlockElement --> Update --> IPROPERTY_TEMPLATES
spoiler
"IPROPERTY_TEMPLATES" => array(
"ELEMENT_META_TITLE" => $element["meta_title"], // title элемента
"ELEMENT_META_KEYWORDS" => $element["meta_keywords"], // ключевые слова элемента
"ELEMENT_META_DESCRIPTION" => $element["meta_description"], // сео-описание элемента
"ELEMENT_PAGE_TITLE" => $element["name"], // title страницы
"ELEMENT_PREVIEW_PICTURE_FILE_ALT" => $element["img"]["alt_text"], // альт для привью (маленькой) картинки
"ELEMENT_PREVIEW_PICTURE_FILE_TITLE" => $element["img"]["title_text"], // тайтл для привью (маленькой) картинки
"ELEMENT_PREVIEW_PICTURE_FILE_NAME" => $element["img"]["name"], // имя прьвью картинки
"ELEMENT_DETAIL_PICTURE_FILE_ALT" => $element["img"]["alt_text"],
"ELEMENT_DETAIL_PICTURE_FILE_TITLE" => $element["img"]["title_text"],
"ELEMENT_DETAIL_PICTURE_FILE_NAME" => $element["img"]["name"],
)

An answer is attached to the question through the element property (there can be several answers, so this is a multiple field)

Sometimes it makes more sense to tie the other way around, in your case to the answers to questions.
What's stopping you from linking the answer to the question in the same way ?
--
And look at this https://dev.1c-bitrix.ru/user_help/service/learnin...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question