How to Prepare a Custom Template
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
A custom template is created based on an existing website or page from the Sites section. The template is then exported and registered using the methods from the landing.demos.* section of the Bitrix24 application.
This page outlines the general workflow. It explains how to prepare the source website, how to obtain the export, and what to pass to the methods in the landing.demos.* section.
When to Use a Custom Template
Use a custom template if you need to:
- add your own template to the website creation wizard
- distribute a ready-made website or page through the application
- reuse the same set of pages, blocks, and settings
If the template only needs to be installed in one Bitrix24 without reuse, it is sufficient to create and configure the website or page in the usual way.
If the template is distributed as an application with a website, refer to the articles Installing Website Templates and Website Requirements Before Publishing.
How a Custom Template Works
A custom template is created based on an existing website from the Sites section. To register the template, you need to:
- Prepare the website and pages
- Export the website using the landing.site.fullExport method
- Pass the exported array to landing.demos.register
After registration, the template appears in the website or page creation wizard.
You can retrieve the list of registered templates using the landing.demos.getList method. Separate lists of templates can be obtained using the landing.demos.getSiteList method for websites and the landing.demos.getPageList method for pages.
How to Prepare the Template
Before exporting, check the website itself:
- pages are correctly linked to each other
- the necessary blocks and themes are used
- images and external resources are accessible via working URLs
- title, description, and preview data are prepared for the template
If the website is multi-page, use a single theme for all pages. This helps maintain a consistent appearance after the template is installed.
How to Register the Template
The minimum process is as follows:
- Create a website or page that will serve as the basis for the template
- Export the website using the landing.site.fullExport method
- Save the export result on the application side
- When installing the application, pass the exported array to landing.demos.register
- Verify that the template appears in the website or page creation wizard
Typically, the result of landing.site.fullExport is passed to landing.demos.register without manual restructuring of the data.
If you need to change the title, description, preview, or localization, these values should be set in the export and registration parameters.
After registration, the template can be verified using the landing.demos.getList method.
What to Consider Before Registration
Template Type. The template data uses the type and tpl_type fields. These define the template type and its usage location in the wizard. Check these fields in the structure you pass to landing.demos.register.
Export Composition. Usually, the complete result of landing.site.fullExport is passed for registration. If the structure is manually modified, ensure that the required fields and the page map items are preserved.
Preview Data. Prepare preview, preview2x, preview3x, and preview_url if the template should be displayed in the list and in the preview.
External Template Code. To delete the template, its external code from the XML_ID field is required. You can obtain it using the landing.demos.getList method. The landing.demos.unregister method removes records by this code within the current application. If both the website template and the page template are registered with the same code, deletion may affect both related records.
Preview URL
preview_url specifies the preview page of the template in the wizard. This URL can be passed when exporting the website via landing.site.fullExport. It is then used during template registration.
For preview_url, a published page that showcases the template in its final form is typically used. For a multi-page website, the main page is sufficient.
Ensure that the preview link remains accessible. Otherwise, the preview page will not open in the wizard.
Images and External Resources
When exporting the website, images and other external resources may be saved as absolute links. After the template is installed, they will be loaded from the original address. This will continue until the user replaces them with their own files.
If the template is distributed to other Bitrix24 accounts, check in advance:
- that all URLs are accessible externally
- that images do not depend on temporary storage
- that preview images will not be deleted
Template Localization
The title and description of the template can be localized during registration. For this, the lang and lang_original parameters are used in landing.demos.register.
If the template is to be displayed in Bitrix24 with different languages, prepare the localization array in advance. For details, see the article Template Localization.
Continue Learning
- Overview of Custom Template Methods
- Register a Template in the Website Creation Wizard
- Get a List of Registered Templates
- Get a List of Templates for Website Creation
- Get a List of Templates for Page Creation
- Export a Website
- Template Localization