Answer the question
In order to leave comments, you need to log in
How to add a variable like {=this.Name} to a regular Bitrix field?
There is a catalog element, it has an SEO tab. Variables of the type {=this.Name} {=this.catalog.price.BASE} are available in the fields of this tab. I am attaching a screenshot
:
If, for example, you set the variables in the "Details" tab in the same way, the
variables will not be substituted, they will be displayed simply as text.
How to make it possible to substitute such variables in the text "detailed"?
Answer the question
In order to leave comments, you need to log in
Variables on the SEO tab are not processed in the fields of other tabs. They are for the SEO tab only.
If you want to use them in detail, then you need to write your own handler for such variables in your template.
For example, you decide to use {=this.Name} in the detail field.
You need to do something like this
$arResult['DETAIL_TEXT']=str_replace('{=this.Name}', $arResult['NAME'], $arResult['DETAIL_TEXT']);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question