1) How, or with what classes and events (API), you can change the section icon, or change the font color of the section that has a certain property set.

For example, I set a custom property for sections, and depending on the value of this property, you need to change the icon of this section to any other in the administrative panel, or make the font red.

enter image description here

2) How can it be possible to set an onClick event with a js script call in the element editing form, for a certain property with the code "ATT_BRAND"?

More details:

In the information block setting, in the "File with the element editing form:" field I connected my php file, pasted the code there, as it is written in the documentation, in this code I found a piece of code where the properties are output via the _ShowPropertyField function, just above the property output code I wrote this:

 <? if($prop_fields["CODE"] == "ATT_BRAND") { ... } ?> 

How now this property (input'u) add your event?

  • one
    I think you should ask two questions - Bald
  • 3
    well, why not the topic: you asked a question in which you ask about 2 unrelated things :) So it’s probably two, and two questions could be given more understandable topics, something like: How to change the style of the menu item in the admin area condition , How to add an event to a custom item . and then your question would be more valuable, because it could help someone, and in the current production it would be difficult to find - Bald
  • Well, what would that change? What would affect. - DDDDDDDDD
  • four
    @DDDDDDDDD, so that these are two unrelated questions. Accordingly, they have two unrelated solutions, therefore they should be set separately - Grundy
  • 3
    @DDDDDDDDD, Well, what would that change? - The rules of the community in which you ask questions would be followed, for example. - Nofate

1 answer 1

On the first question, do not climb into the admin area, otherwise updates will come and everything can be reset. On the second question:

If $prop_code is the key of the array in which the character code sits, then:

 <input type="button" value="Отправить" <?if($prop_code == "ATT_BRAND"):?>onClick=""<?endif?> /> 
  • Thank you very much! 1) I do not want to touch the core. Are there any methods that change the behavior of the kernel? I understand this is unrealizable without changing the engine? 2) ATT_BRAND is my text field, and it is not in the code to add an event to it in this way. This field (property) is added via the _ShowPropertyField function - DDDDDDDDD
  • 1) In general, all that is in the admin panel is in the / bitrix / admin / folder, you can change anything. But again, why do you not understand this. 2) did not understand anything)) - Rustembek Kaliyev
  • 1) Ie when updating / bitrix / admin / not overwritten? so the customer wanted, if the section has a custom property with a specific value, then highlight this section. 2) i.gyazo.com/f37a7782d27dddbf664fadf4b1cbfaf8.png in this place is a search of all properties and their output. In the $prop_fields properties (id, name, value, ..) of the current property (input'a) which will be displayed in the panel. And I check if($prop_fields["CODE"] == "ATT_BRAND") then somehow this property ($ prop_fields) needs to set its event. - DDDDDDDDD