Best Practices for Separate Templates in 1C-Bitrix Multi-Site

When multiple sites live in one Bitrix installation, a shared template turns edits into roulette: you change one store, and another breaks. We set up separate templates for each site, extracting common logic into a base one so design and functionality don't conflict. Our team delivers the project turnkey—from auditing the current structure to implementation and ongoing support.

Our competencies:

Frequently Asked Questions

We've often faced this scenario: a client launches a second (or third) store on the same Bitrix installation, but uses a single template. Layout breaks, customization becomes a nightmare. The mistake is that each site gets its own design, but inheritance is not configured. Using separate templates for each site is the key to avoiding conflicts. Let's break down how to properly organize templates in a multi-site setup without wasting time on duplication. For example, in one project, because of a shared template, edits for the wholesale site broke the retail product card, leading to a 3-day downtime and a loss of about 15% of orders. Separate templates in a multi-site reduce the time required for edits by 4 times compared to a single template. This approach is 75% more efficient than a single template approach.

Why Is It Important to Separate Templates?

If multiple sites live in one Bitrix copy but use a single template, sooner or later you run into style conflicts and edits for one site break another. Separate templates provide flexibility: the retail site can have its own product card, the wholesale site another, the mobile version a third. Common logic is then isolated in a base template. Over 90% of our projects benefit from this structure, and it saves up to 30 hours per month on maintenance.

Template Structure in Multi-Site

Bitrix stores templates in /bitrix/templates/ (system) and /local/templates/ (user). For each site, you set the default template in the admin panel: Settings → Sites → List of Sites → {Site} → Site Template.

Recommended structure for multiple sites:

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

Template inheritance. Bitrix does not support template inheritance natively, but you can simulate it via includes or symbolic links:

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

How We Set Up Templates: A Real Case

Recently we configured a multi-site for a client: a retail store (template retail) and a wholesale platform (wholesale) on the same database. We moved the common header, footer, and analytics scripts into base. For retail, we customized the product card by replacing the catalog.element template in its own folder. For wholesale, we removed prices and added a "Request Quote" button. Everything worked without copying unnecessary code. According to 1C-Bitrix documentation, the multi-site configuration supports separate templates through each site's settings.

How to Assign Component Templates to Different Sites?

For each component, you can set a different template on different sites. Component templates are searched 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 Nuances

CSS and JS resources. Each template has its own style.css and script.js in its root. Bitrix automatically includes them. For builds with Vite or Webpack, set publicPath per template.

Checking 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 a template
if (SITE_ID === 's2') {
    // Logic for wholesale site
}

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

Comparison of Approaches: Shared vs Separate Templates

Criterion One Template for All Separate Templates (Our Approach)
Design flexibility Limited, style conflicts Maximum, each site unique
Maintenance complexity High, edits break other sites Low, isolated changes
Code duplication No explicit, but many conditions Minimal thanks to base template
Development speed for new sites Slow, edits to common code Fast, base is inherited
Detailed example structure

For a project with three sites (retail, wholesale, mobile), the optimal structure:

/local/templates/
 base/
  header.php
  footer.php
  style.css
 retail/
  header.php (include base/header.php with modifications)
  components/bitrix/catalog.element/.default/template.php
 wholesale/
  header.php (include base/header.php, remove cart)
  components/bitrix/catalog.element/.default/template.php (without prices)
 mobile/
  header.php (responsive)
  style.css

What's Included in the Work

  • Analysis of the current template architecture and site map
  • Designing the /local/templates/ structure with base and child templates
  • Migrating existing design into the new structure
  • Configuring inheritance and component overrides
  • Cross-browser and mobile adaptation testing
  • Documenting the structure for future maintenance
  • Handover of access and training for the client's team

How We Do It: Process

  1. Analysis — assess the number of sites and their shared/unique elements.
  2. Design — create a template structure blueprint.
  3. Implementation — deploy the base template and child templates.
  4. Testing — verify each site works correctly.
  5. Deployment — push to the production server.

Approximate Timelines

Configuration Timeline
Setting up 2 templates (basic structure) 1–2 days
Migrating existing design into multi-site structure 2–4 days
Developing templates from scratch for 2–3 sites 5–10 days

Pricing starts at $550 for a basic two-template setup. We handle projects of any complexity — get a consultation for your project, and we'll provide accurate timelines and estimates. Order an audit of your current template structure to uncover hidden issues.

Our Experience and Guarantees

We have been developing on 1C-Bitrix for over five years and have completed more than 40 multi-site projects. We guarantee correct operation of the templates and their compatibility with system updates. Write to us, and we'll evaluate your project and provide accurate timelines.