D
D
Dmitry Klimantovich2021-10-12 12:33:42
1C-Bitrix
Dmitry Klimantovich, 2021-10-12 12:33:42

How to make your changes to the component?

Good afternoon.
I copied the component template to the template folder, but in it I need to display the new values ​​coming from the new property fields from the admin area of ​​the infoblock element.
Earlier, I edited the /bitrix/components/component name/component.php file, created new variables for new fields there, and they became available in the template.php file. But the changes in the component.php file were overwritten during the update. Since it is correct to transfer them to the template.php file

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail Livach, 2021-10-12
@Mausglov

Official ways:
first: extract additional data in the template's result_modifier.php.
Second: customize the component: create a directory, for example
/local/components/dikey58 , copy the system component there, change its description, use it.
Disadvantage: if the site uses a boxed template (or from the Marketplace), then the corrected component calls will be overwritten during updates.
"Gray path":
copy the system component to /local/components/bitrix/ and edit. The downside is that calling the "native" component with this approach will not work

G
Gennady, 2021-10-12
@gkukuruz

If you need to modify a standard component, you can place the modified component in the local folder. More details at the link:
https://dev.1c-bitrix.ru/learning/course/index.php...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question