Views: 1564 (Data available since 06.02.2017)
Last Modified: 10.10.2012
Visual component is logically completed source code, implementing operations with data of exact modules. Virtually any script can be shaped as a component.
You can quickly add components to pages using the visual editor. To insert a component into a page, simply select it in the list and drag and drop it to the desired position within the page.
A distinctive feature of a component is the ability not only to be controlled on the source code level, but also through the use of parameters that define the component behavior.
Note! Using the visual editor you can choose a template which will be used for page displaying. If visual components used on the page are customized for a definite site template then in case of using another site template these components will be displayed as PHP code. It means that the system will not be able to identify these components. In this case you are recommended to choose the proper template (for which the visual components were customized) or use another components.
Also some components can manage site template elements:
- add items to the navigation (breadcrumb) chain (e.g., information blocks and e-store components, );
- assign page title (e.g., information blocks and forum components);
- assign page metadata: keywords and description (e.g., information blocks components).
In the given examples the template elements managing is implemented with use of special visual component parameters. These parameters can be adjusted during editing page in the visual editor mode.
- If a page contains several components each of which can assign the page title then the page title will be set by the last component (with use of the function
- If a page contains several components adding their buttons to the control panel then to avoid the administrative panel overloading assign the visual components property Display panel buttons for this component to No.
- The visual component managing is available only for system administrators. This restriction is used to provide security of site managing since the visual components contain php code.
You can proceed to editing php code used for a component call. To do so use the button , located on the left panel of the visual editor.
Also any arbitrary PHP code can be added to page in the similar manner. In this case, it could be modified in the text editor in the bottom of the screen.
: Any arbitrary php code, placed on a page, in the visual editor mode will be displayed as the picture
The Bitrix Site Manager allows to use on pages almost any php code without damage to visual editing mode.