Views: 9465
Last Modified: 10.09.2014

When working with a composite component, one or more simple components may be modified, leaving the remaining simple components unchanged.

For example, if you want to increase the length of a group description to be displayed from 50 to 100 characters in the component socialnetwork.user_groups, which forms part of the composite component socialnetwork_group and displays a list of groups, then perform the following.

  • Copy the template of the composite component.

    Now, the template of the composite component is located in the website template. If we go there, we will see lots of files in the folder /bitrix/templates/<website template>/components/bitrix/socialnetwork_group/.default.

    Each file is invoked on a specific page of the social network and connects the simple components that are required.

    Now, the file that connects this component must be found and changed. In this case, the file is index.php. The rest of the files in the template of the composite component located in the website template can be deleted. The composite component will connect these files from the core. This means that they will be updated.

  • Now in the remaining file, we replace
    $APPLICATION->IncludeComponent(
                "bitrix:socialnetwork.user_groups",
    with
    $APPLICATION->IncludeComponent(
                "custom:socialnetwork.user_groups",
  • Copy the folder /bitrix/components/bitrix/socialnetwork.user_groups to /bitrix/components/custom/socialnetwork.user_groups.
  • In the file /bitrix/components/custom/socialnetwork.user_groups/component.php replace
    "GROUP_DESCRIPTION" => SubStr($arGroups["GROUP_DESCRIPTION"], 0, 50)."...",
    with
    "GROUP_DESCRIPTION" => SubStr($arGroups["GROUP_DESCRIPTION"], 0, 100)."...",

Now, all of the functional capacity of the social network remains standard, except for the component socialnetwork.user_groups.



Courses developed by Bitrix24