---
name: develop-bus-template
description: Develop 1C-Bitrix site templates — header/footer, page templates, component template overrides within a site template. Use when working with site template files in local/templates/.
---

# Develop БУС Site Template

## Structure

```
local/templates/<name>/
├── header.php             — site header (opens <html>, <head>, <body>, <main>)
├── footer.php             — site footer (closes tags, ShowPanel)
├── styles.css / script.js
├── images/
├── components/            — component template overrides for this site template
│   └── bitrix/<name>/<tpl>/template.php
└── page_templates/        — page type templates
    └── .default.php
```

## Key $APPLICATION calls in templates

```php
$APPLICATION->ShowTitle();        // page title
$APPLICATION->ShowHead();         // <head> assets (CSS, JS, meta)
$APPLICATION->ShowPanel();        // admin edit panel (footer)
$APPLICATION->ShowNavChain();     // breadcrumbs
$APPLICATION->ShowMeta('description');
$this->GetFolder();               // template folder path: /local/templates/myname
SITE_TEMPLATE_ID;                 // current template ID
```

## Minimal header.php

```php
<?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die(); ?>
<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?= $APPLICATION->ShowTitle() ?></title>
    <?= $APPLICATION->ShowHead() ?>
    <link rel="stylesheet" href="<?= $this->GetFolder() ?>/styles.css">
</head>
<body>
<main>
```

## Minimal footer.php

```php
<?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die(); ?>
</main>
<?= $APPLICATION->ShowPanel() ?>
<script src="<?= $this->GetFolder() ?>/script.js"></script>
</body>
</html>
```

## Override component template inside site template

```
local/templates/myname/components/bitrix/news.list/.default/template.php
```
Applied automatically when site uses template `myname`.

## Details

- [page_templates — page type templates](./page-templates.md)
