Setting up separate templates for different 1C-Bitrix sites

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

Configuring Separate Templates for Multiple Sites in 1C-Bitrix

In a multisite 1C-Bitrix setup, several sites share a single installation — common database, common catalog, but different front-end appearances. The goal is to give each site its own template without duplicating shared logic.

Template Structure in a Multisite Setup

1C-Bitrix stores templates in /bitrix/templates/ (system) and /local/templates/ (custom). Each site's default template is set in the admin panel: Settings → Sites → Site List → {Site} → Site Template.

Recommended structure for multiple sites:

/local/templates/
    base/              # Shared base template (layout, header, footer)
    site_retail/       # Retail site template
    site_wholesale/    # Wholesale site template
    site_mobile/       # Mobile version (if not using responsive design)

Template inheritance. 1C-Bitrix does not support template inheritance natively, but it can be emulated using symlinks or includes:

// /local/templates/site_retail/header.php
// Include the shared header and override only what's needed
define('TEMPLATE_BASE_PATH', $_SERVER['DOCUMENT_ROOT'] . '/local/templates/base/');
include TEMPLATE_BASE_PATH . 'header.php';

Binding Components to a Template

Each component can use a different template per site. Component templates are resolved in this order:

  1. /local/templates/{site_template}/components/{namespace}/{component}/{template}/
  2. /local/components/{namespace}/{component}/templates/{template}/
  3. /bitrix/templates/{site_template}/components/...
  4. /bitrix/components/{namespace}/{component}/templates/{template}/

This means: to give the retail site its own product card, simply create /local/templates/site_retail/components/bitrix/catalog.element/.default/template.php.

Practical Considerations

CSS and JS assets. Each template has its own style.css and script.js in its root directory — 1C-Bitrix includes them automatically. When building with Vite or Webpack, configure publicPath per template.

Detecting the current site in code:

// Get the current site ID
$siteId = \Bitrix\Main\Context::getCurrent()->getSite(); // 's1', 's2', etc.

// In components and templates — global constant
define('SITE_ID', $siteId);

// Conditional rendering in template
if (SITE_ID === 's2') {
    // Logic for the wholesale site
}

Language files. Template-specific translations are stored in /local/templates/{template}/lang/{lang}/. 1C-Bitrix loads them automatically when GetMessage() is used.

Timeline

Configuration Timeline
Setting up 2 templates (basic structure) 1–2 days
Migrating an existing design into multisite structure 2–4 days
Building templates from scratch for 2–3 sites 5–10 days